-
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
eks: add ephemeral aws_eks_cluster_auth
resource
#40660
eks: add ephemeral aws_eks_cluster_auth
resource
#40660
Conversation
Community NoteVoting for Prioritization
For Submitters
|
Add return statements in error paths, and reference the EKS cluster name using ValueString to ensure it produces a literal value. This avoids generating the underlying framework’s string literal, which includes quotes and leads to incorrect token generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
% make testacc TESTARGS='-run=TestAccEKSClusterAuthEphemeral_basic' PKG=eks
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/eks/... -v -count 1 -parallel 20 -run=TestAccEKSClusterAuthEphemeral_basic -timeout 360m -vet=off
2025/01/15 14:48:56 Initializing Terraform AWS Provider...
=== RUN TestAccEKSClusterAuthEphemeral_basic
=== PAUSE TestAccEKSClusterAuthEphemeral_basic
=== CONT TestAccEKSClusterAuthEphemeral_basic
--- PASS: TestAccEKSClusterAuthEphemeral_basic (10.05s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/eks 16.539s
@bschaatsbergen thank you for the contribution! 🎉 |
This functionality has been released in v5.84.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. Thank you! |
For folks using things like atlantis, where a output plan file is saved and applied later, is the token also saved to the output file or is it regenerated at apply stage? |
If you use this ephemeral resource, then it should not be persisted to the saved plan, and should be regenerated on apply. |
Fixes #40343
Since it’s common to configure the Kubernetes provider by injecting a temporary IAM-compatible token for authenticating to the EKS control-plane (currently done using
data.aws_eks_cluster_auth.example.token
).Terraform (1.10) supports referencing ephemeral resource attributes directly in providers. Having an ephemeral variant available of
aws_eks_cluster_auth
would greatly improve the security posture of Terraform users working with Amazon EKS and the Kubernetes or Helm provider as the temporary obtained IAM token is no longer persisted to the state.Test output: