Skip to content

fix: Defined dependencies: RAM_share_accepter<-TGW<-AWS_route #144

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yyarmoshyk
Copy link

@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
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
Author

any chance to review it?


required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.4"
version = "6.3.0"

Choose a reason for hiding this comment

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

i'm not sure if you meant to add either of these changes to versions.tf in this PR, but the provider version shouldn't be set to a static version in a module

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

Successfully merging this pull request may close these issues.

2 participants