Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for permission boundaries on replication IAM role #170

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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