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 1
1
data "aws_region" "current" {}
2
2
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
+ }
4
6
5
7
data "aws_caller_identity" "current" {}
6
8
7
9
data "aws_partition" "current" {}
8
10
locals {
9
11
create_bucket = var. create_bucket && var. putin_khuylo
10
12
13
+ create_bucket_acl = (var. acl != null && var. acl != " null" ) || length (local. grants ) > 0
14
+
11
15
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
12
16
13
17
# Variables with type `any` should be jsonencode()'d when value is coming from Terragrunt
@@ -39,7 +43,7 @@ resource "aws_s3_bucket_logging" "this" {
39
43
}
40
44
41
45
resource "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
43
47
44
48
bucket = aws_s3_bucket. this [0 ]. id
45
49
expected_bucket_owner = var. expected_bucket_owner
@@ -67,7 +71,7 @@ resource "aws_s3_bucket_acl" "this" {
67
71
}
68
72
69
73
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 )
71
75
display_name = try (var. owner [" display_name" ], null )
72
76
}
73
77
}
You can’t perform that action at this time.
0 commit comments