provider-ephemeral-resources
Skill by hashicorp
Guides AI assistants in implementing Terraform provider ephemeral resources with the Plugin Framework. It covers the Open, Renew and Close lifecycle, schema design, registration and testing. Aimed at provider developers who handle secrets and short-lived credentials.
Install provider-ephemeral-resources
Built from the published package, never by AI.
git clone --depth 1 https://github.com/hashicorp/agent-skills /tmp/agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agent-skills/plugins/terraform/skills/provider-ephemeral-resources ~/.claude/skills/provider-ephemeral-resourcesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install provider-ephemeral-resources in Claude Code
git clone --depth 1 https://github.com/hashicorp/agent-skills /tmp/agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agent-skills/plugins/terraform/skills/provider-ephemeral-resources ~/.gemini/antigravity-cli/skills/provider-ephemeral-resourcesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install provider-ephemeral-resources in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill is a reference for building ephemeral resources in a Terraform provider using the Plugin Framework. It explains when an ephemeral resource fits better than a data source, and how the Open, Renew and Close methods handle a value that must never be stored in state or plan. It includes a Go example for a token resource, with a lease ID passed between methods through resp.Private and a RenewAt time set with a safety margin.
The skill also covers registration through EphemeralResources and the EphemeralResourceData setting in the provider's Configure method. It lists design rules, such as never logging the value and skipping Close when revocation is not possible. It points to testing with the echoprovider and to tfplugindocs for documentation. It is written for provider developers working on secrets, tokens, certificates and other short-lived credentials.
Written from the project's SKILL.md and checked against it.
What it can do
- Open lifecycle methodFetches or creates the ephemeral value and sets its renewal time.
- Renew lifecycle methodExtends or refreshes the value produced by Open when it is close to expiring.
- Close lifecycle methodRevokes leases or deletes temporary credentials when Terraform is done with the value.
- Ephemeral schema designShows how to mark secret attributes as sensitive and expose the API's own identifiers.
- RegistrationExplains opting in through ProviderWithEphemeralResources and setting EphemeralResourceData in Configure.
- Write-only and provider config flowDescribes how ephemeral values can feed provider configuration and write-only attributes.
- Testing guidanceCovers echoprovider acceptance tests and version gating to Terraform 1.10 or later.
- Documentation guidancePoints to tfplugindocs pages that explain lifetime, renewal and revocation behavior.
What you need
- Terraform 1.10 or later
- A Terraform provider built with the Plugin Framework
- Go, as used in the code examples
Try asking
- Add an ephemeral resource that issues a short-lived token for a role
- Show me how to renew an expiring credential in my Terraform provider
- Should this secret be a data source or an ephemeral resource?
Good to know
- Renew cannot return a new result. It can only extend or refresh what Open produced.
- Ephemeral results cannot be used in regular attributes because those persist to state.
- Terraform renews lazily, not on a precise timer, so a safety margin is needed.
- Close should be skipped if the upstream value cannot be revoked.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: plugins/terraform/skills/provider-ephemeral-resources/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md9 KB
Alternatives to provider-ephemeral-resources
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
provider-ephemeral-resources: common questions
What is an ephemeral resource in Terraform?
According to the source, an ephemeral resource produces values that are never persisted to state or plan. It is meant for secrets such as tokens, generated passwords and short-lived certificates.
When should I use Renew in an ephemeral resource?
The source says Renew is for credentials that expire while Terraform is still running, such as STS-style tokens or short-TTL leases. It is optional and only needed where the API supports it.
How do I test an ephemeral resource?
The source says tests echo the ephemeral value through the echoprovider into a regular resource that the test can inspect. Tests should be gated to Terraform 1.10 or later.
How do I install provider-ephemeral-resources?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is provider-ephemeral-resources free?
The code is published under the MPL-2.0 licence. The service it connects to may have its own pricing.
Is provider-ephemeral-resources safe to use?
It scores 79 of 100. Grades: maintenance B, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to provider-ephemeral-resources?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
