Terraform: v0.11.11
AWS Provider version: tested with 2.2.0 up to 2.10.0
For the below resource, AWS Provider from version 2.2.0 up to 2.10.0 will keep setting the properties transit_gateway_default_route_table_association and transit_gateway_default_route_table_propagation to false even though they are already set to false.
It seems to think that these settings are set to true but they are not.
If I downgrade back to AWS Provider version 1.57.0 which was my previous version before upgrading it, then I don't see this behavior anymore.
resource "aws_ec2_transit_gateway_vpc_attachment" "transit_gateway_vpc_attachment" {
subnet_ids = ["some-sub-id"]
transit_gateway_id = "some-tgw-id"
vpc_id = "some-vpc-id"
dns_support = "enable"
ipv6_support = "disable"
tags = "some-tag"
transit_gateway_default_route_table_association = "false"
transit_gateway_default_route_table_propagation = "false"
}
No change should happen as the resource is already in the configured state.
~ aws_ec2_transit_gateway_vpc_attachment.transit_gateway_vpc_attachment
transit_gateway_default_route_table_association: "true" => "false"
transit_gateway_default_route_table_propagation: "true" => "false"
Upgrade to AWS Provider version 2.2.0 or higher and then:
terraform planHas anyone else noticed this?
Thanks,
Any updates on this?
Thank you
Hi All and Terraform Team,
I am also facing the issue that even if Transit Gateway attachment already created by terraform code and all other things remains the same, every subsequent run of the same code without any change modifies the attachment in place. Can you please look into this priority as I have 100+ account and their VPCs to attach to Transit Gateway.
Below are details for your analysis.
Definition :
resource "aws_ec2_transit_gateway_vpc_attachment" "target_tgw_attach" {
...
transit_gateway_default_route_table_association = false
transit_gateway_default_route_table_propagation = false
}
Plan:
update in place
--
Terraform will perform the following actions:
module.tgw_attachment.aws_ec2_transit_gateway_vpc_attachment.target_tgw_attach[0] will be updated in-place
~ ~ resource "aws_ec2_transit_gateway_vpc_attachment" "target_tgw_attach" {
...
~ transit_gateway_default_route_table_association = true -> false
~ transit_gateway_default_route_table_propagation = true -> false
...
}
Plan: 0 to add, 1 to change, 0 to destroy
Apply :
aws_ec2_transit_gateway_vpc_attachment.target_tgw_attach[0]: Modifying...
aws_ec2_transit_gateway_vpc_attachment.target_tgw_attach[0]: Modifications complete .
version : 12.20
@apparentlymart , sorry to tag you in this issue. But looks like this issue passing from 11 to 12 version.
Could you please have a look.
I think, this gives the answers on why it is always applying the changes even if there is no change in old and new value.
Referring to https://www.terraform.io/docs/providers/aws/r/ec2_transit_gateway_vpc_attachment.html, transit_gateway_default_route_table_association and transit_gateway_default_route_table_propagation cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value: true.
Most helpful comment
Any updates on this?
Thank you