File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11data "aws_region" "current" {}
22
3- data "aws_canonical_user_id" "this" {}
3+ data "aws_canonical_user_id" "this" {
4+ count = local. create_bucket && local. create_bucket_acl && try (var. owner [" id" ], null ) == null ? 1 : 0
5+ }
46
57data "aws_caller_identity" "current" {}
68
79data "aws_partition" "current" {}
810locals {
911 create_bucket = var. create_bucket && var. putin_khuylo
1012
13+ create_bucket_acl = (var. acl != null && var. acl != " null" ) || length (local. grants ) > 0
14+
1115 attach_policy = var. attach_require_latest_tls_policy || var. attach_elb_log_delivery_policy || var. attach_lb_log_delivery_policy || var. attach_deny_insecure_transport_policy || var. attach_inventory_destination_policy || var. attach_deny_incorrect_encryption_headers || var. attach_deny_incorrect_kms_key_sse || var. attach_deny_unencrypted_object_uploads || var. attach_policy
1216
1317 # Variables with type `any` should be jsonencode()'d when value is coming from Terragrunt
@@ -39,7 +43,7 @@ resource "aws_s3_bucket_logging" "this" {
3943}
4044
4145resource "aws_s3_bucket_acl" "this" {
42- count = local. create_bucket && ((var . acl != null && var . acl != " null " ) || length ( local. grants ) > 0 ) ? 1 : 0
46+ count = local. create_bucket && local. create_bucket_acl ? 1 : 0
4347
4448 bucket = aws_s3_bucket. this [0 ]. id
4549 expected_bucket_owner = var. expected_bucket_owner
@@ -67,7 +71,7 @@ resource "aws_s3_bucket_acl" "this" {
6771 }
6872
6973 owner {
70- id = try (var. owner [" id" ], data. aws_canonical_user_id . this . id )
74+ id = try (var. owner [" id" ], data. aws_canonical_user_id . this [ 0 ] . id )
7175 display_name = try (var. owner [" display_name" ], null )
7276 }
7377 }
You can’t perform that action at this time.
0 commit comments