Skip to main content
skill CX Codex

provider-ephemeral-resources — Claude Code skill

Walks a provider author through ephemeral resources on the Terraform Plugin Framework, where secrets reach the config and never land in state or plan.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hashicorp/agent-skills --skill provider-ephemeral-resources -a claude-code
Open on GitHub

What provider-ephemeral-resources does

The skill covers Terraform 1.10+ ephemeral resources. Their whole point is keeping a value out of state and out of plan — issued tokens, generated passwords, short-lived certificates, decrypted secrets.

Three methods make up the lifecycle. Open is required and produces the value. Renew is optional and fires once the clock passes RenewAt. Close is optional and is the place to revoke leases. Lease identifiers travel between calls in resp.Private, so Renew and Close know what to extend or drop. Registration goes through provider.ProviderWithEphemeralResources and its EphemeralResources() method.

Worked Go code is included: struct tags, schema, a sample token resource. One limit matters. Renew cannot hand back a fresh value, it only extends the existing one. If an API rotates the token itself, build Open around a longer-lived value instead. The same guidance covers picking between an ephemeral resource and a data source — sensitive, apply-time-only values go ephemeral; plain read-only lookups stay a data source.

What it helps with

  • add an ephemeral resource to a provider without breaking the build
  • hand a token to a provider block or write-only attribute without persisting it
  • renew an expiring credential during a running Terraform operation
  • revoke a lease on close and leave nothing dangling
  • choose between an ephemeral resource and a data source

Example prompts for the agent

  • Add an ephemeral resource that issues a token for a role, with Open, Renew and Close
  • Register the new ephemeral resource through EphemeralResources in the provider
  • Show how to pass lease_id from Open into Renew via resp.Private

How to install provider-ephemeral-resources

1Skills CLI (Vercel)

npx skills add hashicorp/agent-skills --skill provider-ephemeral-resources -a claude-code

2Manually: put the files in place

~/.claude/skills/provider-ephemeral-resources/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/provider-ephemeral-resources/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about provider-ephemeral-resources

How do I install provider-ephemeral-resources in Claude Code?

Run npx skills add hashicorp/agent-skills --skill provider-ephemeral-resources -a claude-code. The skill lands at ~/.claude/skills/provider-ephemeral-resources/SKILL.md.

What does provider-ephemeral-resources do?

It guides implementation of ephemeral resources in a Terraform provider on the Plugin Framework: schema, registration, the Open/Renew/Close cycle, and value passing through resp.Private.

What is the difference between an ephemeral resource and a data source?

A data source suits read-only lookups of non-sensitive data. Pick an ephemeral resource when the value is secret and only needed at apply time, so it stays out of state and plan.

Similar skills

All skills for DevOps and infrastructure →

From the same set20

aws-ami-builder A skill that walks your agent through building Amazon Machine Images with Packer and the amazon-ebs builder — template, source AMI filters, build commands. CX Codex +1 3,200installs provider-docs Guides Terraform provider documentation workflows for the Terraform Registry. It coordinates schema descriptions, docs templates, and tfplugindocs generation. CX Codex +1 3,200installs push-to-registry Teaches AI assistants how to register Packer build details in HCP. Useful for tracking machine image lifecycles and linking artifacts directly to Terraform. CX Codex +1 3,000installs windows-builder A skill for building Windows images with Packer over WinRM and PowerShell provisioners. Useful for Windows AMIs, Azure images and VMware templates. CX Codex +1 2,700installs azure-image-builder This skill guides Packer builds for Azure managed images and Azure Compute Gallery. Use it when preparing custom images for Azure virtual machines. CX Codex +1 2,700installs terraform-policy Creates and tests Terraform Policy files, and converts Sentinel rules into Terraform Policy. Use it when policy files or their test cases need changes. CX Codex +1 1,500installs provider-configuration Guides Terraform provider authentication and credential resolution. Use it when designing a provider schema, wiring Configure(), or investigating missing credentials. CX Codex +1 951installs provider-framework-migration Guides per-resource migrations from Terraform Plugin SDKv2 to the Plugin Framework. Covers mux setup, schema translation, and state compatibility checks. CX Codex +1 913installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor