Skip to content

r/aws_ec2_transit_gateway_route_table_association: Add configurable timeouts - #49924

Open
trh-ds wants to merge 2 commits into
hashicorp:mainfrom
trh-ds:f-tgw-rt-association-timeouts
Open

r/aws_ec2_transit_gateway_route_table_association: Add configurable timeouts#49924
trh-ds wants to merge 2 commits into
hashicorp:mainfrom
trh-ds:f-tgw-rt-association-timeouts

Conversation

@trh-ds

@trh-ds trh-ds commented Sep 9, 2026

Copy link
Copy Markdown

Description

aws_ec2_transit_gateway_route_table_association waited on a hard-coded 5 minute create timeout, with no way for users to extend it. As reported in #42705, associations can legitimately take ~10 minutes, so the apply fails even though the association eventually succeeds:

Error: waiting for EC2 Transit Gateway Route Table Association (tgw-rtb-…_tgw-attach-…) create:
timeout while waiting for state to become 'associated' (last state: 'associating', timeout: 5m0s)

This adds a timeouts block to the resource. The previously hard-coded durations become the defaults, so behavior is unchanged unless a user opts in:

resource "aws_ec2_transit_gateway_route_table_association" "example" {
  transit_gateway_attachment_id  = aws_ec2_transit_gateway_vpc_attachment.example.id
  transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id

  timeouts {
    create = "15m"
  }
}

Implementation notes:

  • waitTransitGatewayRouteTableAssociationCreated / …Deleted and disassociateTransitGatewayRouteTable now take a timeout time.Duration, following the existing convention in this package (e.g. waitTransitGatewayUpdated).
  • Only the resource itself passes d.Timeout(...). The shared helpers used by the attachment resources (transitgateway_vpc_attachment.go, transitgateway_vpc_attachment_accepter.go, transitgateway_connect.go) and transitgateway_policy_table_association.go pass the pre-existing transitGatewayRouteTableAssociation{Created,Deleted}Timeout constants, so those code paths are untouched.

Relations

Closes #42705

References

Output from Acceptance Testing

I do not have an AWS account available to run the Transit Gateway acceptance tests, so I have not run them. The change is limited to plumbing a configurable duration into the existing waiters; the defaults are byte-for-byte the previous constants, so TestAccTransitGatewayRouteTableAssociation_* should be unaffected. Happy to add a timeouts-specific test case if a maintainer would like one.

$ make testacc TESTS=TestAccTransitGatewayRouteTableAssociation PKG=ec2
# not run — no AWS credentials available

GenAI / LLM Assisted Development

This change was written with the assistance of Claude Code. I have reviewed the diff.

…imeouts

Association and disassociation of a Transit Gateway route table can take
well over the previously hard-coded 5 minute create timeout, leaving
users no way to extend it.

Add a `timeouts` block to the resource, keeping the existing durations as
the defaults (create 5m, delete 10m). The waiters and
disassociateTransitGatewayRouteTable now take a timeout; all other callers
pass the existing constants, so their behavior is unchanged.

Closes hashicorp#42705

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8tTGeYq33eHbEe9NZVzus
@trh-ds
trh-ds requested a review from a team as a code owner September 9, 2026 19:11
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8tTGeYq33eHbEe9NZVzus
@github-actions github-actions Bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. service/transitgateway Issues and PRs that pertain to the transitgateway service. size/S Managed by automation to categorize the size of a PR. labels Sep 9, 2026
@justinretzolk

Copy link
Copy Markdown
Member

Relates #42738

@justinretzolk justinretzolk added timeouts Pertains to timeout increases. enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/transitgateway Issues and PRs that pertain to the transitgateway service. size/S Managed by automation to categorize the size of a PR. timeouts Pertains to timeout increases.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws_ec2_transit_gateway_route_table_association support for timeouts block

2 participants