Terraform taste — ChatGPT prompt: what it does, how to use
This prompt lays out Terraform practices for project structure, state management, and CI checks. Use it to review an infrastructure configuration or draft conventions for a repository.
Open on GitHubWhat Terraform taste does
The prompt covers pinned Terraform and provider versions, remote state with locking, and separate state for each environment and system. It recommends focused modules, typed variables with descriptions, and safeguards against deleting resources that hold stateful data.
For team workflows, it suggests running terraform fmt, validate, and tflint on every pull request, then sharing the plan for review and applying it from CI. It also addresses OIDC authentication, secrets managers, and scheduled drift checks. Pinning Terraform and provider versions matters: otherwise, the configuration can change between runs.
What it helps with
- split Terraform state by environment and system
- set up Terraform checks for pull requests
- guard databases and buckets against accidental deletion
- move secrets out of tfvars and into a secrets manager
- detect infrastructure drift on a schedule
Example prompts for the agent
- Review my Terraform configuration against the cloud platform engineering practices in this prompt and list issues.
- Suggest a Terraform project layout with separate directories for prod and staging.
- Draft a pull request checklist for Terraform that includes
terraform fmt,validate, andtflint.
How to install Terraform taste
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Terraform taste
How do I install Terraform taste in ChatGPT?
There is no separate ChatGPT install command listed. Use the prompt text in a ChatGPT or Claude.ai conversation.
What does Terraform taste do?
It gives guidance on Terraform and provider versions, module design, remote state, and CI checks.
Which Terraform checks does the prompt recommend for CI?
It recommends running terraform fmt, validate, and tflint on every pull request, then posting the plan for review.
Source text
prompts.csv · CC0-1.0
# Terraform taste of a cloud platform engineer - Pin the Terraform version and every provider version, and commit .terraform.lock.hcl. Confidence: 0.95 - Store state remotely with locking enabled, for example S3 with DynamoDB or Terraform Cloud. Confidence: 0.95 - Split state per environment and per system so one apply never touches everything. Confidence: 0.90 - Use separate directories per environment instead of Terraform workspaces for prod and staging. Confidence: 0.75 - Keep modules small and focused on one concern, such as a network or a database. Confidence: 0.85 - Pin module sources to a tag or version, never to a moving branch. Confidence: 0.90 - Give every variable a type and a description, and add validation blocks for risky inputs. Confidence: 0.85 - Expose only the outputs that other stacks actually consume. Confidence: 0.70 - Name resources in snake_case and avoid repeating the resource type in the name. Confidence: 0.75 - Apply a shared tag set (owner, environment, cost center) through provider default_tags. Confidence: 0.85 - Prefer for_each over count so adding or removing an item does not reshuffle addresses. Confidence: 0.90 - Use moved blocks for refactors instead of manual terraform state mv. Confidence: 0.85 - Bring existing resources in with import blocks that are reviewed in a pull request. Confidence: 0.80 - Run terraform fmt, validate and tflint in CI on every pull request. Confidence: 0.90 - Post the terraform plan output as a pull request comment for review. Confidence: 0.85 - Apply only from CI using the reviewed plan file, never from a laptop. Confidence: 0.85 - Authenticate CI to the cloud with OIDC instead of long-lived access keys. Confidence: 0.90 - Never put secrets in tfvars; read them from a secrets manager at apply time. Confidence: 0.90 - Use prevent_destroy on stateful resources like databases and buckets. Confidence: 0.80 - Scan configurations with a policy tool such as checkov or tfsec before merging. Confidence: 0.75 - Avoid provisioners and local-exec; hand configuration off to images or config tools. Confidence: 0.80 - Run a scheduled plan to detect drift and alert when it is not empty. Confidence: 0.75 - Keep data sources for lookups and avoid hardcoding IDs or ARNs. Confidence: 0.80
© f · CC0-1.0 · f/prompts.chat