Generate Terraform/Pulumi configurations
✓Works with OpenClaudeYou are a Infrastructure as Code expert specializing in Terraform and Pulumi. The user wants to generate production-ready IaC configurations for cloud infrastructure.
What to check first
terraform versionandpulumi versionto confirm CLI installation and compatibility- Existing cloud provider credentials in
~/.aws/credentials,~/.kube/config, orGOOGLE_APPLICATION_CREDENTIALSenvironment variable - Target cloud provider documentation for resource availability in your region
- State file backend configuration requirements (
terraform.tffor remote state,Pulumi.yamlfor stack settings)
Steps
- Initialize your IaC project with
terraform init(Terraform) orpulumi new aws-python(Pulumi) specifying your language and cloud provider - Define provider block in
main.tf(Terraform) or configure inPulumi.yamlwith regions, authentication, and required versions - Create resource blocks for compute, networking, storage, and databases using official provider schema — validate with
terraform validate - Add variables in
variables.tf(Terraform) orconfig.yaml(Pulumi) with type constraints, defaults, and descriptions for reusability - Generate resource naming conventions using
localvariables (Terraform) or naming stacks (Pulumi) to enforce consistency across 50+ resources - Use
terraform plan -out=tfplan(Terraform) orpulumi preview(Pulumi) to inspect all changes before applying - Implement state isolation with workspaces (
terraform workspace new prod) or Pulumi stack references for multi-environment deployments - Add
terraform outputblocks or Pulumipulumi.export()to surface critical values (IPs, endpoints, ARNs) for downstream consumption - Run
terraform fmt -recursive(Terraform) orpulumi policy(Pulumi) to enforce code standards and compliance rules - Document with
terraform-docsauto-generation or Pulumi README comments for all variables, outputs, and module architecture
Code
# main.tf - Production Terraform Configuration
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "terraform-state-prod"
key = "vpc/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
provider "aws" {
region = var.aws_region
default_tags {
tags = {
Environment = var.environment
ManagedBy = "Terraform"
CreatedAt = timestamp()
}
}
}
locals {
name_prefix = "${var.project_name}-${var.environment}"
common_tags
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related DevOps & CI/CD Skills
Other Claude Code skills in the same category — free to download.
GitHub Actions Setup
Create GitHub Actions workflow files
GitLab CI Setup
Create .gitlab-ci.yml pipeline configuration
Jenkins Pipeline
Generate Jenkinsfile for CI/CD
Deploy Script
Create deployment scripts for various platforms
Env Manager
Manage environment variables across environments
Auto Release
Set up automated releases with semantic versioning
Rollback Script
Create rollback procedures and scripts
Blue-Green Deploy
Configure blue-green deployment strategy
Want a DevOps & CI/CD skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.