-
Notifications
You must be signed in to change notification settings - Fork 379
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
Feature Request: Ability to specify default tags at provider level #1478
Comments
This would be great. We use locals {
tags = {
service : basename(get_terragrunt_dir())
env : basename(dirname(get_terragrunt_dir()))
region : basename(dirname(dirname(get_terragrunt_dir())))
created_by : "terraform"
version : get_env("GITHUB_RUN_ID", "Manual")
modified_by : get_platform() == "windows" ? get_env("USERNAME") : get_env("USER", "unknown")
}
}
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
provider "aws" {
region = "${local.tags.region}"
default_tags {
tags = {
service : "${local.tags.service}"
env : "${local.tags.env}"
region : "${local.tags.region}"
created_by : "${local.tags.created_by}"
version : "${local.tags.version}"
modified_by : "${local.tags.modified_by}"
}
}
}
EOF
} |
+1 for this. It would be immensely helpful. |
+1 too. |
It will be really helpfull to have this feature, it make it easier to enforce some defaults tags on all the datadog ressources like aws. |
+1 for this as well. However, this PR #2486 seems to consider tags as key-values instead of lists. Shouldn't the default tags be a list to match the tags set at the resources level? |
Also, the nesting of |
Terraform Version
1.2.1 (although this is a provider request)
Affected Resource(s)
All resource types that support tags
Details
It would be great if it were possible to define a set of default tags at the provider level, that automatically get applied to all resources managed by a given provider instance. This feature is inspired by a similar feature in the AWS provider.
This would change the provider declaration to look something like this:
Similar to the AWS provider, if tags are also defined on a specific resource they would be combined with the default tags, overriding any default tags with the same key.
The text was updated successfully, but these errors were encountered: