From 424de84a0102fd792b03ba1383ee1eb452722edf Mon Sep 17 00:00:00 2001 From: Amila Kumaranayaka Date: Wed, 13 Nov 2024 15:07:33 +0000 Subject: [PATCH] fix: correct bucket name to fix broken `-replication` role (#250) * fix: fixes broken replication name * fix: use local value Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> * fix: use bucket name from local Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> * fix(replication): missing quote, created local --------- Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> --- replication.tf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/replication.tf b/replication.tf index da46d23b..ee1d7671 100644 --- a/replication.tf +++ b/replication.tf @@ -1,7 +1,11 @@ +locals { + replication_role = format("%s-replication", local.bucket_name) +} + resource "aws_iam_role" "replication" { count = local.replication_enabled ? 1 : 0 - name = format("%s-replication", module.this.id) + name = local.replication_role assume_role_policy = data.aws_iam_policy_document.replication_sts[0].json permissions_boundary = var.s3_replication_permissions_boundary_arn @@ -28,7 +32,7 @@ data "aws_iam_policy_document" "replication_sts" { resource "aws_iam_policy" "replication" { count = local.replication_enabled ? 1 : 0 - name = format("%s-replication", module.this.id) + name = local.replication_role policy = data.aws_iam_policy_document.replication[0].json tags = module.this.tags