Skip to content

Commit

Permalink
Merge pull request #30 from babbel/resource-specific-tags
Browse files Browse the repository at this point in the history
Add support for resource-specific tags
  • Loading branch information
jansiwy authored Sep 24, 2024
2 parents 94d827c + 0761f85 commit 73d42e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bucket.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "aws_s3_bucket" "this" {
bucket = var.bucket_name

tags = var.default_tags
tags = merge(var.default_tags, var.s3_bucket_tags)
}

data "aws_iam_policy_document" "bucket_policy" {
Expand Down
2 changes: 1 addition & 1 deletion cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource "aws_cloudfront_distribution" "this" {
}
}

tags = var.default_tags
tags = merge(var.default_tags, var.cloudfront_distribution_tags)
}

locals {
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ Name of the S3 bucket to create.
EOS
}

variable "cloudfront_distribution_tags" {
type = map(string)
default = {}

description = <<EOS
Map of tags assigned to the CloudFront distribution created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

variable "custom_error_response" {
type = list(
object({
Expand Down Expand Up @@ -89,6 +98,15 @@ Supported HTTP versions set on the CloudFront distribution.
EOS
}

variable "s3_bucket_tags" {
type = map(string)
default = {}

description = <<EOS
Map of tags assigned to the S3 bucket created by this module. Tags in this map will override tags in `var.default_tags`.
EOS
}

variable "trusted_key_groups" {
type = list(
object({
Expand Down

0 comments on commit 73d42e7

Please sign in to comment.