Skip to content

Commit 424de84

Browse files
amila-kunitrocode
andauthored
fix: correct bucket name to fix broken -replication role (#250)
* fix: fixes broken replication name * fix: use local value Co-authored-by: nitrocode <[email protected]> * fix: use bucket name from local Co-authored-by: nitrocode <[email protected]> * fix(replication): missing quote, created local --------- Co-authored-by: nitrocode <[email protected]>
1 parent af75f1c commit 424de84

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

replication.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
locals {
2+
replication_role = format("%s-replication", local.bucket_name)
3+
}
4+
15
resource "aws_iam_role" "replication" {
26
count = local.replication_enabled ? 1 : 0
37

4-
name = format("%s-replication", module.this.id)
8+
name = local.replication_role
59
assume_role_policy = data.aws_iam_policy_document.replication_sts[0].json
610
permissions_boundary = var.s3_replication_permissions_boundary_arn
711

@@ -28,7 +32,7 @@ data "aws_iam_policy_document" "replication_sts" {
2832
resource "aws_iam_policy" "replication" {
2933
count = local.replication_enabled ? 1 : 0
3034

31-
name = format("%s-replication", module.this.id)
35+
name = local.replication_role
3236
policy = data.aws_iam_policy_document.replication[0].json
3337

3438
tags = module.this.tags

0 commit comments

Comments
 (0)