Skip to content

Commit

Permalink
Clean up locals.
Browse files Browse the repository at this point in the history
  • Loading branch information
korenyoni committed Jan 16, 2022
1 parent 43b2b53 commit 64a4328
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module "s3_bucket" {
allowed_bucket_actions = var.allowed_bucket_actions
bucket_name = var.bucket_name
object_lock_configuration = var.object_lock_configuration
s3_replication_enabled = local.replication_enabled
s3_replication_enabled = local.s3_replication_enabled
s3_replica_bucket_arn = join("", module.s3_bucket_replication_target.*.bucket_arn)
s3_replication_rules = local.s3_replication_rules
privileged_principal_actions = var.privileged_principal_actions
Expand Down
9 changes: 4 additions & 5 deletions examples/complete/replication.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
replication_enabled = var.s3_replication_enabled
replication_rules = local.replication_enabled ? [
s3_replication_enabled = var.s3_replication_enabled
s3_replication_rules = local.s3_replication_enabled ? [
{
id = "replication-test-explicit-bucket"
status = "Enabled"
Expand Down Expand Up @@ -28,11 +28,10 @@ locals {
}
}
] : []
s3_replication_rules = local.replication_rules
}

module "s3_bucket_replication_target" {
count = local.replication_enabled ? 1 : 0
count = local.s3_replication_enabled ? 1 : 0

source = "../../"

Expand All @@ -47,7 +46,7 @@ module "s3_bucket_replication_target" {
}

module "s3_bucket_replication_target_extra" {
count = local.replication_enabled ? 1 : 0
count = local.s3_replication_enabled ? 1 : 0

source = "../../"

Expand Down

0 comments on commit 64a4328

Please sign in to comment.