Skip to content

Commit fff09c1

Browse files
committed
update test case
1 parent 6f6a147 commit fff09c1

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

internal/services/dataprotection/data_protection_backup_instance_data_lake_storage_resource_test.go

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ resource "azurerm_storage_account" "test" {
118118
}
119119
120120
resource "azurerm_storage_container" "test" {
121-
name = "testaccsc%[3]d"
122-
storage_account_name = azurerm_storage_account.test.name
121+
name = "testaccsc%[3]d"
122+
storage_account_id = azurerm_storage_account.test.id
123123
}
124124
125125
resource "azurerm_storage_container" "another" {
126-
name = "testaccsc2%[3]d"
127-
storage_account_name = azurerm_storage_account.test.name
126+
name = "testaccsc2%[3]d"
127+
storage_account_id = azurerm_storage_account.test.id
128128
}
129129
130130
resource "azurerm_data_protection_backup_vault" "test" {
@@ -156,9 +156,32 @@ resource "azurerm_data_protection_backup_policy_data_lake_storage" "test" {
156156
resource "azurerm_data_protection_backup_policy_data_lake_storage" "another" {
157157
name = "acctest-dbp-other-%[1]d"
158158
data_protection_backup_vault_id = azurerm_data_protection_backup_vault.test.id
159-
backup_schedule = ["R/2021-05-23T02:30:00+00:00/P1W"]
159+
backup_schedule = ["R/2021-05-23T02:30:00+00:00/P1W", "R/2021-05-24T03:40:00+00:00/P1W"]
160+
time_zone = "Coordinated Universal Time"
160161
161162
default_retention_duration = "P4M"
163+
164+
retention_rule {
165+
name = "weekly"
166+
duration = "P6M"
167+
absolute_criteria = "FirstOfWeek"
168+
}
169+
170+
retention_rule {
171+
name = "thursday"
172+
duration = "P1W"
173+
days_of_week = ["Thursday", "Friday"]
174+
months_of_year = ["November", "December"]
175+
scheduled_backup_times = ["2021-05-23T02:30:00Z"]
176+
}
177+
178+
retention_rule {
179+
name = "monthly"
180+
duration = "P1D"
181+
weeks_of_month = ["First", "Last"]
182+
days_of_week = ["Tuesday"]
183+
scheduled_backup_times = ["2021-05-23T02:30:00Z", "2021-05-24T03:40:00Z"]
184+
}
162185
}
163186
`, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(8))
164187
}
@@ -206,8 +229,8 @@ resource "azurerm_data_protection_backup_instance_data_lake_storage" "test" {
206229
data_protection_backup_vault_id = azurerm_data_protection_backup_vault.test.id
207230
location = azurerm_resource_group.test.location
208231
storage_account_id = azurerm_storage_account.test.id
209-
backup_policy_id = azurerm_data_protection_backup_policy_data_lake_storage.test.id
210-
storage_account_container_names = [azurerm_storage_container.test.name]
232+
backup_policy_id = azurerm_data_protection_backup_policy_data_lake_storage.another.id
233+
storage_account_container_names = [azurerm_storage_container.test.name, azurerm_storage_container.another.name]
211234
212235
depends_on = [azurerm_role_assignment.test]
213236
}

0 commit comments

Comments
 (0)