Skip to content

Commit 7e7cfe8

Browse files
authored
Partial revert of #14 (#15)
1 parent 5e36dd2 commit 7e7cfe8

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

_locals.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ locals {
1212

1313
# Helper vars for optional blocks. Will either be an empty set (no) or a
1414
# single item set (yes)
15-
needs_backup_configuration = var.primary_instance_name == null ? [0] : []
16-
needs_maintenance_window = var.primary_instance_name == null ? [0] : []
15+
needs_maintenance_window = var.primary_instance_name == null ? [0] : []
1716
}

instance.tf

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@ resource "google_sql_database_instance" "instance" {
1515
tier = local.tier
1616
user_labels = local.labels
1717

18-
dynamic "backup_configuration" {
19-
for_each = local.needs_backup_configuration
20-
21-
content {
22-
enabled = coalesce(var.backup_config.enabled, var.highly_available)
23-
start_time = var.backup_config.start_time
24-
point_in_time_recovery_enabled = var.backup_config.point_in_time_recovery_enabled
25-
location = coalesce(var.backup_config.enabled, var.highly_available) ? var.backup_config.location : null
26-
transaction_log_retention_days = var.backup_config.transaction_log_retention_days
27-
backup_retention_settings {
28-
retained_backups = var.backup_config.retained_backups
29-
retention_unit = "COUNT"
30-
}
18+
backup_configuration {
19+
enabled = coalesce(var.backup_config.enabled, var.highly_available)
20+
start_time = var.backup_config.start_time
21+
point_in_time_recovery_enabled = var.backup_config.point_in_time_recovery_enabled
22+
location = coalesce(var.backup_config.enabled, var.highly_available) ? var.backup_config.location : null
23+
transaction_log_retention_days = var.backup_config.transaction_log_retention_days
24+
backup_retention_settings {
25+
retained_backups = var.backup_config.retained_backups
26+
retention_unit = "COUNT"
3127
}
3228
}
3329

0 commit comments

Comments
 (0)