diff --git a/terraform/aws/buckets.tf b/terraform/aws/buckets.tf index eb51a3dee4..aa263b25f5 100644 --- a/terraform/aws/buckets.tf +++ b/terraform/aws/buckets.tf @@ -1,7 +1,7 @@ resource "aws_s3_bucket" "user_buckets" { for_each = var.user_buckets bucket = lower("${var.cluster_name}-${each.key}") - tags = var.tags + tags = merge(var.tags, each.value.tags) } resource "aws_s3_bucket_lifecycle_configuration" "user_bucket_expiry" { diff --git a/terraform/aws/variables.tf b/terraform/aws/variables.tf index 4b8dd02f6c..1caec04816 100644 --- a/terraform/aws/variables.tf +++ b/terraform/aws/variables.tf @@ -23,7 +23,8 @@ variable "user_buckets" { type = map( object({ delete_after : optional(number, null), - archival_storageclass_after : optional(number, null) + archival_storageclass_after : optional(number, null), + tags : optional(map(string), {}), }) ) default = {} @@ -40,6 +41,7 @@ variable "user_buckets" { 2. `archival_storageclass_after` - number of days after *creation* an object in this bucket will be automatically transitioned to a cheaper, slower storageclass for cost savings. Set to null to not transition. + 3. `tags` - bucket specific tags to be merged into the general tags variable. EOT }