Skip to content

Commit

Permalink
Add support for permission boundaries on replication IAM role (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchristopher authored May 5, 2023
1 parent e7e7541 commit 83afe36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions replication.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
resource "aws_iam_role" "replication" {
count = local.replication_enabled ? 1 : 0

name = format("%s-replication", module.this.id)
assume_role_policy = data.aws_iam_policy_document.replication_sts[0].json
name = format("%s-replication", module.this.id)
assume_role_policy = data.aws_iam_policy_document.replication_sts[0].json
permissions_boundary = var.s3_replication_permission_boundary_arn
}

data "aws_iam_policy_document" "replication_sts" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ variable "s3_replication_source_roles" {
description = "Cross-account IAM Role ARNs that will be allowed to perform S3 replication to this bucket (for replication within the same AWS account, it's not necessary to adjust the bucket policy)."
}

variable "s3_replication_permission_boundary_arn" {
type = string
default = null
description = "Permission boundary ARN of the IAM replication role. Defaults to null."
}

variable "bucket_name" {
type = string
default = null
Expand Down

0 comments on commit 83afe36

Please sign in to comment.