Skip to content

Commit

Permalink
Merge pull request #28 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 a11ab6a + 28abd48 commit bdb4a45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_secretsmanager_secret" "this" {
name = "${var.name_prefix}.database_url"
description = "Secret value is managed via Terraform"

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

resource "aws_secretsmanager_secret_version" "this" {
Expand Down
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@ variable "rds_cluster" {
Database cluster to be used in the `DATABASE_URL`.
EOS
}

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

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

0 comments on commit bdb4a45

Please sign in to comment.