feat: add terraform-modernize skill for ephemeral resources and write-only arguments#47
Open
garvitarai1 wants to merge 2 commits intohashicorp:mainfrom
Open
feat: add terraform-modernize skill for ephemeral resources and write-only arguments#47garvitarai1 wants to merge 2 commits intohashicorp:mainfrom
garvitarai1 wants to merge 2 commits intohashicorp:mainfrom
Conversation
…-only arguments Add a new skill that helps modernize Terraform configurations to use: - Ephemeral resources (Terraform 1.10+) for transient sensitive data - Write-only arguments (Terraform 1.11+) to remove secrets from state The skill includes: - Main SKILL.md with workflows and migration patterns - Scripts to check provider support for ephemeral and write-only features - Comprehensive reference documentation - 5 common migration patterns with before/after examples Key features: - Provider-aware: checks actual provider schema for feature support - Validation-focused: emphasizes terraform validate at each step - Security-first: shows how to eliminate secrets from state files - Links to version-upgrades skill for prerequisites Tested with AWS and Random providers. Achieves 80% Tessl review score. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
Tessl Skill Review Results
Checks: frontmatter validity, required fields, body structure, examples, line count. |
quixoticmonk
reviewed
Mar 9, 2026
| fi | ||
|
|
||
| # Get provider key | ||
| provider_key=$(terraform providers schema -json 2>/dev/null | jq -r '.provider_schemas | keys[]' | grep "/${PROVIDER}$" || true) |
Contributor
There was a problem hiding this comment.
We could have the schema command output saves for usage across the script once with something like ..
SCHEMA=$(terraform providers schema -json 2>/dev/null)
provider_key=$(jq -r '.provider_schemas | keys[]' <<< "$SCHEMA" | grep "/$1$")
Author
There was a problem hiding this comment.
Ya thats a great idea! I'll make the update
- Cache terraform providers schema -json output once per execution - Reuse cached SCHEMA variable instead of repeated calls - Reduces schema queries from 3 calls to 1 per script run - Addresses PR feedback from @quixoticmonk Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
terraform-modernizeskill that helps modernize Terraform configurations to use ephemeral resources (Terraform 1.10+) and write-only arguments (Terraform 1.11+) for improved security and state management.Motivation
As Terraform introduces new security features like ephemeral resources and write-only arguments, users need guidance on when and how to adopt them. This skill provides:
terraform validateProvider-Agnostic Design
This skill works with any Terraform provider, not just AWS:
terraform providers schema -json./check_ephemeral_support.sh <provider-name>Examples use AWS for illustration since it has comprehensive support, but all workflows and patterns apply universally to any provider.
Key Features
1. Ephemeral Resources (Terraform 1.10+)
Replaces data sources with ephemeral resources for transient, sensitive data that shouldn't persist in state:
2. Write-only Arguments (Terraform 1.11+)
Uses
_wosuffix arguments to accept sensitive values without storing them in state:3. Provider-Aware Detection
Includes scripts that query provider schemas to detect feature support:
check_ephemeral_support.sh- Lists ephemeral resources available in a providercheck_writeonly_support.sh- Lists write-only arguments available in a providerWorks with any provider: AWS, Azure, GCP, Random, TLS, and any future providers.
Skill Structure
Following the Agent Skills specification:
ephemeral-resources.md- Lifecycle, contexts, edge caseswrite-only-arguments.md- Syntax, versioning, state behaviorephemeral-contexts.md- Valid usage contextsmigration-patterns.md- 5 comprehensive migration patternsTesting
terraform validateRelated Work
🤖 Generated with Claude Code