Skip to content

Conversation

yyarmoshyk
Copy link
Contributor

@yyarmoshyk yyarmoshyk commented Jul 2, 2025

Description

Defined dependencies: aws_ram_resource_share_accepter<-aws_ec2_transit_gateway_vpc_attachment<-aws_route.this

Motivation and Context

I was using this module to wire the transit gateway from one account to another (peer account) and the code fails to create route table in peer VPC because of the missing resource ordering. It creates route table in peering VPC before accepting the RAM share and TGW attachment to the VPC.

Terragrunt apply fails with the following error:

module.tgw.aws_route.this["rtb-111111"]: Still creating... [4m50s elapsed]
╷
│ Error: creating EC2 Transit Gateway VPC Attachment: InvalidTransitGatewayID.NotFound: Transit Gateway tgw-111111111 was deleted or does not exist.
│ 	status code: 400, request id: 92dda22e-9e61-43e6-bab7-e2fe1744f0d0
│ 
│   with module.tgw.aws_ec2_transit_gateway_vpc_attachment.this["dev"],
│   on .terraform/modules/tgw/main.tf line 66, in resource "aws_ec2_transit_gateway_vpc_attachment" "this":
│   66: resource "aws_ec2_transit_gateway_vpc_attachment" "this" {
│ 
╵
╷
│ Error: creating Route in Route Table (rtb-111111) with destination (0.0.0.0/0): InvalidTransitGatewayID.NotFound: The transitGateway ID 'tgw-08c63a2acff677f14' does not exist.
│ 	status code: 400, request id: 5ac5d791-8be1-474e-b625-a3bf95cc369b
│ 
│   with module.tgw.aws_route.this["rtb-111111"],
│   on .terraform/modules/tgw/main.tf line 113, in resource "aws_route" "this":
│  113: resource "aws_route" "this" {

Breaking Changes

No.

How Has This Been Tested?

  • I have executed pre-commit run -a on my pull request
  • I tested my changes on 2 customer projects with terragrunt where I was creating the transit gateway in networking account and shared it with 5 other accounts. Without this dependencies definition the terragrunt was failing with the error I mentioned initially.

@yyarmoshyk
Copy link
Contributor Author

@antonbabenko I don't see a way to ask for review here. The previous PR I had expired and got closed automatically :)

@yyarmoshyk
Copy link
Contributor Author

any chance to review it?

@mohag
Copy link

mohag commented Aug 18, 2025

spam to keep bot from closing it

Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Sep 20, 2025
@antonbabenko antonbabenko changed the title fix: Defined dependencies: RAM_share_accepter<-TGW<-AWS_route fix: Defined dependencies for aws_ram_resource_share_accepter and aws_route Sep 23, 2025
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments before we can merge it and move on further.

@antonbabenko antonbabenko merged commit 6a09286 into terraform-aws-modules:master Sep 23, 2025
7 checks passed
antonbabenko pushed a commit that referenced this pull request Sep 23, 2025
## [2.13.1](v2.13.0...v2.13.1) (2025-09-23)

### Bug Fixes

* Defined dependencies for aws_ram_resource_share_accepter and aws_route ([#144](#144)) ([6a09286](6a09286))
@antonbabenko
Copy link
Member

This PR is included in version 2.13.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants