-
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
data source aws_ec2_transit_gateway_route_table doesn't feed data properly in plan phase to resource "aws_ec2_transit_gateway_route" #11554
Comments
This code was developed with tf 0.11.14 and migrated to tf 0.12.18. |
Workaround: add null data source between tgwrtb data source and resource add_private_route_1. |
Is there a reason you can't use
|
Well, at the stage the question rather was why would it fail with tf0.12? |
provider.aws v2.46.0 also fails. |
You may be seeing an issue w/ AWS eventual consistency. In other words, the TGW creation may come back as successful, but the describe-transit-gateway API may not be reporting its existence right away. |
The sample code fails already in planning stage. So this isn't dependent on eventual consistency. It doesn't honor input of |
I would reiterate my suggestion of using the alternate code I provided. Does that work? |
tf0.13 seems to be even stricter :-)
|
After doing some additional testing I have to get back to this. I looks more like an issue with the data source than the resource. |
pasting TF_LOG output
|
During the plan phase the data source is obviously empty.
|
I believe that's expected behavior of Terraform. To quote https://www.terraform.io/docs/configuration/data-sources.html
|
Actually that's exactly not my understanding: |
So, I'm making the value itself dependant on the filter item within the data source and apply can be executed successfully (0.12.29, 0.13.5, 0.14.0)
|
Hi all, I was working through this problem with @tbugfinder in a community forum topic and so I wanted to just report back and share what we learned there. The short version (please see the forum topic for the long version!) is that the data source {
"type": "string",
"description_kind": "plain",
"optional": true
} Because of that, Terraform Core sees that it isn't set in the configuration and uses Marking this |
That code appears out of date. Have you updated your code to the latest AWS provider? The current code shows:
|
If I swap Looking at provider 3.20 code base:
"Unfortunately" or obviously apply fails if arn is used :-D |
From some quick searching, some affected data sources:
Adding |
After getting the provider built with |
apply phase finished successfully. |
The fix for the noted data sources above has been merged and will release with version 3.21.0 of the Terraform AWS Provider, likely tomorrow. Thank you @apparentlymart and @tbugfinder. 👍 |
This has been released in version 3.21.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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 v0.12.19
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Terraform should start creating the resources and querying the data source once needed before creating the resource.
Actual Behavior
terraform analyzes the code and cannot resolve the data source properly so it fails.
Steps to Reproduce
terraform plan
Important Factoids
References
The text was updated successfully, but these errors were encountered: