generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.database.tf
37 lines (31 loc) · 1.29 KB
/
main.database.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
resource "azurerm_mssql_managed_database" "this" {
for_each = var.databases
managed_instance_id = azurerm_mssql_managed_instance.this.id
name = each.value.name
short_term_retention_days = each.value.short_term_retention_days
dynamic "long_term_retention_policy" {
for_each = each.value.long_term_retention_policy == null ? [] : [each.value.long_term_retention_policy]
content {
monthly_retention = long_term_retention_policy.value.monthly_retention
week_of_year = long_term_retention_policy.value.week_of_year
weekly_retention = long_term_retention_policy.value.weekly_retention
yearly_retention = long_term_retention_policy.value.yearly_retention
}
}
dynamic "point_in_time_restore" {
for_each = each.value.point_in_time_restore == null ? [] : [each.value.point_in_time_restore]
content {
restore_point_in_time = point_in_time_restore.value.restore_point_in_time
source_database_id = point_in_time_restore.value.source_database_id
}
}
dynamic "timeouts" {
for_each = each.value.timeouts == null ? [] : [each.value.timeouts]
content {
create = timeouts.value.create
delete = timeouts.value.delete
read = timeouts.value.read
update = timeouts.value.update
}
}
}