Make destroy protection environment aware

This commit is contained in:
2026-11-14 14:05:19 +09:00
parent 94a5c2bf55
commit a1453034c3
8 changed files with 84 additions and 28 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import {
for_each = local.bucket_names
to = module.audit_logging_encryption.aws_s3_bucket.this[each.key]
to = module.audit_logging_encryption.aws_s3_bucket.protected[each.key]
id = each.value
}
@@ -41,7 +41,7 @@ import {
}
import {
to = module.audit_logging_encryption.aws_kms_key.vault
to = module.audit_logging_encryption.aws_kms_key.vault_protected[0]
id = "46975f6d-881a-4188-8fdf-b641e1258a85"
}
+2 -1
View File
@@ -24,7 +24,8 @@ module "audit_logging_encryption" {
name_prefix = var.name_prefix
account_id = var.account_id
bucket_names = local.bucket_names
protect_from_destroy = true
bucket_names = local.bucket_names
trail_name = "management-events"
kms_alias_name = "alias/vault-kms"