Skip to content

ephemeral resource: Add kubernetes_secret and kubernetes_secret_v1 support #2670

@shivasheesh-yadav

Description

@shivasheesh-yadav

Description

We fetch kubernetes secrets in terraform using data source, but they end up getting stored in terraform state file.
We would like to use the new feature "ephemeral resources" so that kubernetes secrets aren't stored in terraform state.

Potential Terraform Configuration

ephemeral "kubernetes_secret" "test_secret" {
  metadata {
    name      = "test-secret"
    namespace = "test-namespace"
  }
}

locals {
  test_secret_data = ephemeral.kubernetes_secret.test_secret.data["password"]
}

References

https://www.hashicorp.com/blog/terraform-1-10-improves-handling-secrets-in-state-with-ephemeral-values
https://developer.hashicorp.com/terraform/language/resources/ephemeral

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions