-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add support for default_tags in provider #625
Comments
I know the description is still "Unsure. Some research is required" but was hoping to gain some momentum by highlighting this proposed work-a-round in the original provider issue: hashicorp/terraform-provider-aws#19204 (comment) This vpc module is the last module preventing my company from utilizing the |
I also encountered problems using ╷
│ Error: 1 error occurred:
│ * "tags" are identical to those in the "default_tags" configuration block of the provider: please de-duplicate and try again
│
│
│
│ with module.vpc.aws_vpc.this[0],
│ on .terraform/modules/vpc/main.tf line 25, in resource "aws_vpc" "this":
│ 25: resource "aws_vpc" "this" {
│
╵ Here is the workaround I used to fix the problem. locals {
default_tags = {
DefaultTag1 = "value1"
DefaultTags2 = "value2"
}
}
# AWS provider to use everywhere except with the 'terraform-aws-vpc' module.
provider "aws" {
default_tags {
tags = local.default_tags
}
}
# AWS provider to be used with the 'terraform-aws-vpc' module to prevent an error with 'default_tags'.
#
# see https://github.com/terraform-aws-modules/terraform-aws-vpc/issues/625
provider "aws" {
alias = "vpc"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "3.7.0"
...
public_subnet_tags = merge(
local.default_tags,
{
"PublicSubNetTag1" = "xxxx"
}
)
private_subnet_tags = merge(
local.default_tags,
{
"PrivateSubnetTag1" = "xxxx"
}
)
tags = local.default_tags
providers = {
aws = aws.vpc
}
} Hope this helps. |
This issue has been automatically marked as stale because it has been open 30 days |
This issue was automatically closed because of stale in 10 days |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Is your request related to a new offering from AWS?
default_tags
in provider were introduced in v3.33.0 - hashicorp/terraform-provider-aws#17974Is your request related to a problem? Please describe.
There are several related issues:
hashicorp/terraform-provider-aws#18311
hashicorp/terraform-provider-aws#18366
Describe the solution you'd like.
Unsure. Some research is required.
The text was updated successfully, but these errors were encountered: