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

transit gateway route tables not found from shared account when re-running after initial creation using multiple providers #11029

Open
mrlogsd opened this issue Nov 26, 2019 · 7 comments
Labels
service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@mrlogsd
Copy link

mrlogsd commented Nov 26, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.16

  • provider.aws v2.39.0

Affected Resource(s)

aws_ec2_transit_gateway_vpc_attachment
data.aws_ec2_transit_gateway

Terraform Configuration Files

main.tf.txt
variables.tf.txt

Debug Output

Error: error updating EC2 Transit Gateway Attachment (tgw-attach-xxxxxxxxxxxxxx) Route Table (tgw-rtb-xxxxxxxxxxxxxx) propagation: error determining EC2 Transit Gateway Attachment (tgw-attach-xxxxxxxxxxxxxx) propagation to Route Table (tgw-rtb-xxxxxxxxxxxxxx): InvalidRouteTableID.NotFound: Transit Gateway Route Table tgw-rtb-xxxxxxxxxxxxxx was deleted or does not exist.
status code: 400, request id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

on main.tf line 164, in resource "aws_ec2_transit_gateway_vpc_attachment" "masterTGWGeneral":
164: resource "aws_ec2_transit_gateway_vpc_attachment" "masterTGWGeneral" {

Panic Output

Expected Behavior

Terraform works as expected and creates a vpc with an associated transit gateway on the first run, but subsequent runs can not find the transit gateway route tables.

Transit gateway route table from external aws provider account should be found and used.

Actual Behavior

terraform looks in the wrong provider for the TG route table and cant find it. exits with error
Transit Gateway Route Table was deleted or does not exist, but the correct IDs are in the output and are verified to exist in the respective aws provider accounts

Steps to Reproduce

  1. terraform apply
  2. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Nov 26, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 26, 2019
@mrlogsd
Copy link
Author

mrlogsd commented Dec 5, 2019

anyone else come across this error, InvalidRouteTableID.NotFound, when running terraform on a second run?

@kinzar1
Copy link

kinzar1 commented Sep 30, 2020

I'm having this issue. Did you find out what was wrong?

@mrlogsd
Copy link
Author

mrlogsd commented Oct 21, 2020

It seems to be an order of operations requirement. I defined a aws_ec2_transit_gateway_vpc_attachment resource before trying to define any aws_route or aws_route_table_association resources. This seemed to work reliably everytime. I never found this documented anywhere as a requirement.

@justinretzolk
Copy link
Member

Hey y'all 👋 Thank you for taking the time to file this issue and for the additional discussion around it! Given that there's been a number of AWS provider releases since you initially filed it, can anyone confirm if you're still experiencing this behavior?

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 18, 2021
@mrlogsd
Copy link
Author

mrlogsd commented Nov 22, 2021 via email

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 22, 2021
@niblORRRR
Copy link

I managed to get this working by setting the provider in the route resource. But would be good if that wasn't required.

@ewbankkit
Copy link
Contributor

Relates #8383.
Relates #17398.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

No branches or pull requests

5 participants