-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
EC2 Transit Gateway VPC Attachment "Transit gateway route table was deleted or no longer exists" when attaching to Shared Transit Gateway from another AWS Account #6670
Comments
still a problem in Terraform Version .11.11 using TFE (assume provider is 1.54) |
Hi, |
Seeing same as @sethbacon |
I am experiencing the same issues with Terraform v0.11.11 and provider.aws v1.54.0. |
Experiencing the same issue with Terraform v0.11.11 and provider.aws v1.55.0. Any update? |
Also still present in v0.11.10/v1.56.0. And, during the same apply:
The first error says the TGW is gone; the second says it's there with attachments. How can both be true? |
Same here. VPC attachment get created no issues there, but then error comes up with a route table:
|
I'm also having this issue v0.11.11 + v1.56.0. After applying, refreshing state fails with the |
Same issue as everyone else above even with:
Any updates on a fix? |
…as deleted or no longer exists" when attaching to Shared Transit Gateway from another AWS Account hashicorp#6670 Managing transit gateway route tables does not seem to make sense for a shared TGW In transit gateway attachement resource, add checks to see if the VPC has the same owner as the TGW. If not, skip the route table sections.
@bflad Not sure if you are aware of this. Can you please take a look? Thanks! |
@bflad Having the exact same issue. Do you need to create a route table and a route on each account and link them to the Transit Gateway to make it work? Not sure if it solves this issue, but I will try it out. |
Hi Folks 👋 (and thanks to @andrewsuperbrilliant for an initial fix implementation 🥇), sorry for the hassle and delays here! When the EC2 Transit Gateway resources were initially under development prior to its general availability release around AWS re:Invent last year, the Resource Access Manager (RAM) service was announced around the same time, so its functionality and interaction with Transit Gateways was unknown at the time. 😅 Generally in Terraform, we do not have Terraform resources for ensuring infrastructure removal beyond cases unless we are completely managing the whole configuration for a piece of infrastructure. Managing the full EC2 Transit Gateway Default Route Table seemed problematic given how Routes are inserted automatically in many scenarios. As a compromise, the intention of the As outlined in this issue, trying to read and manage the EC2 Transit Gateway Default Route Table configuration for a RAM shared EC2 Transit Gateway is not possible. The fix as started by #7513 is on the correct path, but is missing covering acceptance testing to ensure this functionality works with Terraform resource import and prevent regressions. Historically we have not setup the Terraform AWS Provider acceptance testing with multiple AWS accounts, so we have spent some time getting an implementation of that going that is easy to implement across potentially hundreds of acceptance tests. The good news here is that #7513 will get some review items today just for the resource changes and adding some additional documentation. After those are addressed, we will merge in the fixes for this issue. After a certain degree of testing complexity, especially for new acceptance testing concepts that may need additional vetting, we do not fully expect every contributor to be able to implement the testing to the maintainer's desires so we will accept the contribution after manually verifying it one last time using placeholder testing with our new setup (to be merged in separately after the fact). We should be able to get the fixes released either middle of this upcoming week or the next. The timing and release numbers are a little indeterminate at the moment as we are looking to merge in Terraform 0.12 provider support, which is still being finalized, so apologies for being more vague than usual on the timing and version. |
The fix for this has been merged and will release with version 2.2.0 of the Terraform AWS Provider, likely later today. |
This has been released in version 2.2.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
@bflad Thank you for fixing/releasing the fix for this issue. Please note that if you have an existing transit_gateway_vpc_attachment that already has the flags for the default_route_table set to "true" it fails when trying to update them to "false". I had to delete the resource, run a terraform apply to delete it and then re-add it.
|
There also still seems to be an issue if you run another apply since just like the previous comment it's trying to modify it again from true to false. Creation of attachment:
Next run of Terraform plan/apply:
Edit - I am using the newly released 2.2.0 version:
|
@sestary are you explicitly configuring those two arguments to resource "aws_ec2_transit_gateway_vpc_attachment" "default" {
# ... other configuration ...
transit_gateway_default_route_table_association = false
transit_gateway_default_route_table_propagation = false
} Configuring that argument for shared EC2 Transit Gateways is not supported as noted in the updated resource documentation:
Removing those two arguments should resolve your issue. If that's not the case here or the documentation is not clear, please create a new GitHub issue for further triage. Thanks. |
Removing those two arguments did resolve my issue. Should be error message be updated to reflect that they are not valid in this case instead of "route table does not exist"? Thank you for your help. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform: 0.11.10
AWS Provider: 1.50.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/amall015/01e86a35645824f9fd6e035fc05c0483
Panic Output
N/A
Expected Behavior
Transit gateway VPC attachment should be created using shared Transit gateway from another account without describing the default route table, since the rtb information is not retrievable in the context of the shared account.
Actual Behavior
Error is produced stating:
Steps to Reproduce
terraform apply
Important Factoids
The VPC attachment resource IS created successfully. However the error always appears when trying to refresh the information about the resource. So the first plan works, the apply creates the resource and then fails, and then all plans after fail.
References
Spawned from comment in:
EC2 Transit Gateway attachment associations cannot be non-default #6664
#6664 (comment)
The text was updated successfully, but these errors were encountered: