Skip to content

[Bug]: aws_ec2_transit_gateway - Modifying default_route_table_association or default_route_table_propagation arguments to enable it is causing the replacement #34449

@evairmarinho

Description

@evairmarinho

Terraform Core Version

1.1.5

AWS Provider Version

5.24.0

Affected Resource(s)

aws_ec2_transit_gateway

Expected Behavior

Modifying default_route_table_association or default_route_table_propagation arguments to enable should not cause the replacement of Transit Gateway.

Actual Behavior

Modifying default_route_table_association or default_route_table_propagation arguments to enable it is causing the replacement of Transit Gateway.

Relevant Error/Panic Output Snippet

# aws_ec2_transit_gateway.this[0] must be replaced
-/+ resource "aws_ec2_transit_gateway" "this" {
      ~ arn                                = "arn:aws:ec2:us-east-1:<NONE>:transit-gateway/tgw-<NONE>" -> (known after apply)
      + association_default_route_table_id = (known after apply)
      ~ default_route_table_association    = "disable" -> "enable" # forces replacement
      ~ default_route_table_propagation    = "disable" -> "enable" # forces replacement
      ~ id                                 = "tgw-<NONE>" -> (known after apply)
      ~ owner_id                           = "<NONE>" -> (known after apply)
      + propagation_default_route_table_id = (known after apply)
        tags                               = {
            "Name" = "tgw-poc"
        }
      - transit_gateway_cidr_blocks        = [] -> null
        # (7 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 2 to add, 0 to change, 2 to destroy.

Terraform Configuration Files

resource "aws_ec2_transit_gateway" "this" {
  amazon_side_asn                 = 65512
  auto_accept_shared_attachments  = "disable"
  default_route_table_association = "disable"
  default_route_table_propagation = "disable"
  description                     = "tgw-poc"
  dns_support                     = "enable"
  multicast_support               = "disable"
  vpn_ecmp_support                = "enable"
}

resource "aws_ec2_transit_gateway_route_table" "this" {
  transit_gateway_id = aws_ec2_transit_gateway.this.id
}

Steps to Reproduce

  • Create a aws_ec2_transit_gateway with default_route_table_association and default_route_table_propagation arguments set to enable

  • Modify default_route_table_association and default_route_table_propagation arguments to "enable"

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

In CloudFormation, this behavior does not exists:
image
TGW CloudFormation

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/transitgatewayIssues and PRs that pertain to the transitgateway service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions