Skip to content

Commit

Permalink
fix: correct bucket name to fix broken -replication role (cloudposs…
Browse files Browse the repository at this point in the history
…e#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]>
  • Loading branch information
amila-ku and nitrocode authored Nov 13, 2024
1 parent af75f1c commit 424de84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions replication.tf
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down

0 comments on commit 424de84

Please sign in to comment.