File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1
- locals {
2
- replication_role = format (" %s-replication" , local. bucket_name )
3
- }
4
-
5
1
resource "aws_iam_role" "replication" {
6
2
count = local. replication_enabled ? 1 : 0
7
3
8
- name = local. replication_role
4
+ name = format ( " %s-replication " , local. bucket_name )
9
5
assume_role_policy = data. aws_iam_policy_document . replication_sts [0 ]. json
10
6
permissions_boundary = var. s3_replication_permissions_boundary_arn
11
7
@@ -32,7 +28,7 @@ data "aws_iam_policy_document" "replication_sts" {
32
28
resource "aws_iam_policy" "replication" {
33
29
count = local. replication_enabled ? 1 : 0
34
30
35
- name = local . replication_role
31
+ name = aws_iam_role . replication [ 0 ] . name
36
32
policy = data. aws_iam_policy_document . replication [0 ]. json
37
33
38
34
tags = module. this . tags
@@ -68,6 +64,7 @@ data "aws_iam_policy_document" "replication" {
68
64
resources = toset (concat (
69
65
try (length (var. s3_replica_bucket_arn ), 0 ) > 0 ? [" ${ var . s3_replica_bucket_arn } /*" ] : [],
70
66
[for rule in local . s3_replication_rules : " ${ rule . destination_bucket } /*" if try (length (rule. destination_bucket ), 0 ) > 0 ],
67
+ [for rule in local . s3_replication_rules : " ${ rule . destination . bucket } /*" if try (length (rule. destination . bucket ), 0 ) > 0 ],
71
68
))
72
69
}
73
70
}
You can’t perform that action at this time.
0 commit comments