Skip to content
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

[Bug]: aws_ec2_transit_gateway_route_table_association resource is getting replaced #32195

Closed
shilp120 opened this issue Jun 23, 2023 · 2 comments
Labels
bug Addresses a defect in current functionality. service/transitgateway Issues and PRs that pertain to the transitgateway service.

Comments

@shilp120
Copy link

Terraform Core Version

Terraform v1.3.7

AWS Provider Version

provider registry.terraform.io/hashicorp/aws v5.5.0

Affected Resource(s)

aws_ec2_transit_gateway_route_table_association seems to be recreated

Expected Behavior

aws_ec2_transit_gateway_route_table_association resource should not be getting replaced due to an optional attribute. But this is causing an existing association to be replaced.

Actual Behavior

  # aws_ec2_transit_gateway_route_table_association.this[0] must be replaced
-/+ resource "aws_ec2_transit_gateway_route_table_association" "this" {
      ~ id                             = "tgw-rtb-XXXX_tgw-attach-XXXX" -> (known after apply)
      + replace_existing_association   = false
      ~ resource_id                    = "XXXX" -> (known after apply)
      ~ resource_type                  = "direct-connect-gateway" -> (known after apply)
      ~ transit_gateway_attachment_id  = "tgw-attach-XXXX"-> (known after apply) # forces replacement
        # (1 unchanged attribute hidden)
    }

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

data "aws_ec2_transit_gateway_dx_gateway_attachment" "this" {
  transit_gateway_id = aws_dx_gateway_association.this[0].associated_gateway_id
  dx_gateway_id      = aws_dx_gateway_association.this[0].dx_gateway_id
}

resource "aws_ec2_transit_gateway_route_table_association" "this" {
  count = var.create_tgw_dcg_association ? 1 : 0

  transit_gateway_attachment_id  = data.aws_ec2_transit_gateway_dx_gateway_attachment.this.id
  transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.this[var.tgw_dcg_association_table].id
}

Steps to Reproduce

After upgrading the aws provider version to v5.5.0, we get this error. This seems to be added in https://github.com/hashicorp/terraform-provider-aws/releases/tag/v5.2.0 for the Issue - #31452

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@shilp120 shilp120 added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 23, 2023
@github-actions github-actions bot added the service/transitgateway Issues and PRs that pertain to the transitgateway service. label Jun 23, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot removed the needs-triage Waiting for first response or review from a maintainer. label Jun 23, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/transitgateway Issues and PRs that pertain to the transitgateway service.
Projects
None yet
Development

No branches or pull requests

1 participant