-
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
aws_eks_cluster_auth should not cache token in plan #13189
Comments
Hi @llamahunter 👋 Just wanted to drop a quick note here that Terraform Providers (like the Terraform AWS Provider) cannot control this behavior themselves. Terraform Core, which manages the ordering of dependencies and handling of saved plan files, would need changes to optionally support the lack of caching for data sources in a saved plan file. You may want to consider checking that repository's issues to see if this has been requested or otherwise raise a new feature request. If saved plans are required, then you may need to perform the authentication outside of Terraform and use a Terraform or environment variable. |
For atlantis workflows, you kind of want saved plans. It is unfortunate that the aws provider eks data objects aren't compatible with that. It's undesirable to have to configured this outside of terraform, since all the data exists within terraform, but not in a useable way. I'll go poke the terraform core people and see whether they are willing to fix this, or have a workaround that the aws provider can use to not cache credentials in the plan. |
Closing this in preference of the upstream issue, since this is not something we can adjust in the Terraform AWS Provider itself: hashicorp/terraform#24886 |
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.24
Affected Resource(s)
Terraform Configuration Files
Debug Output
From terraform apply:
From EKS authorization log:
Note the very stale X-Amz-Date token (2020-05-06 01:09:00Z) relative to the current time (2020-05-06T05:17:59Z). The token date corresponds to the time at which the terraform plan was run, several hours earlier.
Panic Output
n/a
Expected Behavior
data.aws_eks_cluster_auth.example.token should be refreshed on apply. Authentication tokens should not be cached as part of the plan.
Actual Behavior
data.aws_eks_cluster_auth.example.token is cached in the plan, and attempted to be reused later on apply. But, tokens only have validity for 15 minutes.
Steps to Reproduce
terraform plan
and save plan outputterraform apply
existing cached planImportant Factoids
We are using atlantis to apply terraform plans. From the command line, we didn't notice this problem because we don't cache the plans, but re-generate on every apply. Atlantis, however, caches the plans for a more rigorous workflow.
References
This issue is sort of related, but not really.
This issue is sort of the reverse problem for the kubernetes provider, maybe?
The text was updated successfully, but these errors were encountered: