hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.87k stars 9.21k forks source link

[New ephemeral]: aws_eks_cluster_auth should be turned into an ephemeral resource #40343

Open erpel opened 5 days ago

erpel commented 5 days ago

Description

The data source aws_eks_cluster_auth causes the token to be saved in the plan and potentially expiring before the apply. This is discussed in https://github.com/hashicorp/terraform-provider-aws/issues/13189. The new ephemeral resources in terraform 1.10 should address this perfectly:

Requested Resource(s) and/or Data Source(s)

Potential Terraform Configuration

data "aws_eks_cluster" "example" {
  name = "example"
}

ephemeral "aws_eks_cluster_auth" "example" {
  name = "example"
}

provider "kubernetes" {
  host                   = data.aws_eks_cluster.example.endpoint
  cluster_ca_certificate = base64decode(data.aws_eks_cluster.example.certificate_authority[0].data)
  token                  = ephemeral.aws_eks_cluster_auth.example.token
}

References

Original issue: https://github.com/hashicorp/terraform-provider-aws/issues/13189.

Documentation:

Example of other ephemeral resources in terraform-provider-aws:

Would you like to implement a fix?

None

github-actions[bot] commented 5 days ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue