Skip to content

Commit

Permalink
Allow multiple path_prefixes and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
abeluck committed Aug 11, 2023
1 parent be62f51 commit e38a596
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
12 changes: 9 additions & 3 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ usage: |-
dns_alias_enabled = true
parent_zone_name = "cloudposse.com"
deployment_principal_arns = {
"arn:aws:iam::123456789012:role/principal1" = ["prefix1/", "prefix2/"]
"arn:aws:iam::123456789012:role/principal2" = [""]
deployment_principals = {
"principal1": {
"arn": "arn:aws:iam::123456789012:role/principal1"
"path_prefixes": ["prefix1/", "prefix2/"]
},
"principal2": {
"arn": "arn:aws:iam::123456789012:role/principal2"
"path_prefixes": [""]
}
}
}
```
Expand Down
3 changes: 1 addition & 2 deletions deprecated.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ locals {

# New variables, but declare them here for consistency
cloudfront_access_log_create_bucket = var.cloudfront_access_log_create_bucket
}

}
7 changes: 4 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -481,18 +481,19 @@ variable "versioning_enabled" {
}

variable "deployment_principals" {
type = map(object({ path_prefix = string, arn = string }))
type = map(object({ path_prefix = list(string), arn = string }))
default = {}
description = <<-EOT
(Optional) Map of IAM Principal ARNs to lists of S3 path prefixes to grant `deployment_actions` permissions.
(Optional) Map of objects that define the IAM Principal's to grant `deployment_actions` permissions. Each object in the map should have an IAM Principal ARN and a list of S3 path
prefixes to scope that principal's actions in the bucket.
Resource list will include the bucket itself along with all the prefixes. Prefixes should not begin with '/'.
EOT
}

variable "deployment_actions" {
type = list(string)
default = ["s3:PutObject", "s3:PutObjectAcl", "s3:GetObject", "s3:DeleteObject", "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:GetBucketLocation", "s3:AbortMultipartUpload"]
description = "List of actions to permit `deployment_principal_arns` to perform on bucket and bucket prefixes (see `deployment_principal_arns`)"
description = "List of actions to permit `deployment_principals` to perform on bucket and bucket prefixes (see `deployment_principals`)"
}

variable "cloudfront_origin_access_identity_iam_arn" {
Expand Down

0 comments on commit e38a596

Please sign in to comment.