智能体工作流

provider-ephemeral-resources

hashicorp/agent-skills

Implement Terraform provider ephemeral resources with the Plugin Framework: the Open/Renew/Close lifecycle, ephemeral schema design, registration via EphemeralResources, renewal for expiring credentials, and how ephemeral values flow into write-only attributes and provider configuration. Use when adding an ephemeral resource, exposing secrets/tokens/certificates that must never persist in state or plan, deciding between an ephemeral resource and a data source, or wiring short-lived credentials from one provider into another.

  • 966 次安装
  • 910 星标
  • 收录于

安装命令

npx skills add https://github.com/hashicorp/agent-skills --skill provider-ephemeral-resources

SKILL.md

Terraform Provider Ephemeral Resources

Ephemeral resources (Terraform 1.10+) produce values that are never persisted to state or plan. They exist for exactly one job: handing secrets — tokens, generated passwords, short-lived certificates, decrypted values — to the parts of a configuration that need them, without writing them to disk. Any data source that returns a sensitive value is a candidate to be (or to also exist as) an ephemeral resource.

Official docs: Ephemeral Resources.

When to Use One

Situation Use
Read-only lookup of non-sensitive data Data source
Value is sensitive and only needed at apply time (DB password for a provider block, token for a write-only attribute) Ephemeral resource
Sensitive value that downstream managed resources must store (e.g. as an attribute) Regular resource/data source — but pair with write-only attributes where possible
Credential that expires mid-operation (STS-style tokens, short-TTL leases) Ephemeral resource with Renew