| name | pulumi |
| description | Pulumi Infrastructure as Code: define cloud infrastructure in TypeScript, Python, or Go — AWS, GCP, Azure, Kubernetes — with full programming language power instead of YAML/HCL |
Pulumi Skill
When to activate
- Defining cloud infrastructure in TypeScript, Python, or Go instead of HCL/YAML
- Teams already using TypeScript/Python who want to avoid learning Terraform syntax
- Complex infrastructure that benefits from loops, conditionals, and abstractions
- Reusing infrastructure patterns across projects as npm/pip packages
- Migrating from Terraform or CloudFormation to a programming language
When NOT to use
- Simple infrastructure managed by a team fluent in Terraform — don't switch for no reason
- Existing Terraform codebase — stick with it; don't mix unless migrating
- Infrastructure defined by a cloud console wizard — generate Terraform from the console export instead
Instructions
Project setup
curl -fsSL https://get.pulumi.com | sh
pulumi login
mkdir infra && cd infra
pulumi new aws-typescript
pulumi new gcp-python
pulumi new azure-typescript
pulumi new kubernetes-typescript
npm install @pulumi/aws @pulumi/awsx
npm install @pulumi/gcp
npm install @pulumi/azure-native
npm install @pulumi/kubernetes
pulumi config set aws:region us-east-1
pulumi config set --secret db:password "mypassword"
pulumi up
pulumi up --yes
pulumi destroy
pulumi stack ls
AWS infrastructure
Define AWS infrastructure for [application] in TypeScript.
Application: [describe]
Resources: [VPC / ECS / RDS / Lambda / S3 / etc.]
import * as pulumi from '@pulumi/pulumi'
import * as aws from '@pulumi/aws'
import * as awsx from '@pulumi/awsx'
const config = new pulumi.Config()
const dbPassword = config.requireSecret('dbPassword')
const environment = pulumi.getStack()
const vpc = new awsx.ec2.Vpc('main-vpc', {
numberOfAvailabilityZones: 2,
subnetSpecs: [
{ type: awsx.ec2.SubnetType.Public },
{ type: awsx.ec2.. },
],
})
db = aws..(, {
: ,
: ,
: environment === ? : ,
: ,
: ,
: ,
: dbPassword,
: [dbSecurityGroup.],
: dbSubnetGroup.,
: environment !== ,
: environment === ,
: { : environment, : },
})
cluster = aws..()
service = awsx..(, {
: cluster.,
: {
: vpc.,
: [apiSecurityGroup.],
},
: {
: {
: ,
: ,
: ,
: ,
: [
{ : , : environment },
{ : , : db..( ) },
],
: [{ : }],
},
},
: environment === ? : ,
})
apiEndpoint = loadBalancer.
dbEndpoint = db.
the infrastructure my application.
Multi-environment stacks
Set up multi-environment infrastructure with Pulumi stacks.
Environments: [dev / staging / production]
config:
myapp:dbInstanceClass: db.t3.micro
myapp:desiredCount: 1
myapp:enableDeletion: true
config:
myapp:dbInstanceClass: db.t3.large
myapp:desiredCount: 3
myapp:enableDeletion: false
myapp:multiAz: true
const config = new pulumi.Config()
const instanceClass = config.get('dbInstanceClass') ?? 'db.t3.micro'
const desiredCount = config.getNumber('desiredCount') ?? 1
pulumi stack select prod
pulumi up
pulumi stack select staging && pulumi up --yes
Kubernetes with Pulumi
Deploy Kubernetes resources using Pulumi TypeScript.
import * as k8s from '@pulumi/kubernetes'
const appLabels = { app: 'my-service', version: '1.0.0' }
const deployment = new k8s.apps.v1.Deployment('my-service', {
metadata: { namespace: 'production' },
spec: {
replicas: 3,
selector: { matchLabels: appLabels },
template: {
metadata: { labels: appLabels },
spec: {
containers: [{
name: 'api',
image: 'my-registry/my-service:v1.0.0',
resources: {
requests: { cpu: '100m', memory: '128Mi' },
limits: { cpu: '500m', memory: '512Mi' },
},
env: [
{ name: 'NODE_ENV', : },
{
: ,
: {
: { : , : }
}
}
],
: [{ : }],
: {
: { : , : },
: ,
},
}],
},
},
: {
: ,
: { : , : },
},
},
})
nginx = k8s...(, {
: ,
: { : },
: ,
: ,
: {
: { : },
},
})
Example
User: We use Terraform but our team is TypeScript developers who hate HCL. Should we switch to Pulumi?
Claude's assessment:
If your team is strong TypeScript developers and you're starting fresh or have < 2 years of Terraform history, yes — switch now. Here's why and why not:
Switch to Pulumi if:
- Team knows TypeScript, resists learning HCL
- You need loops, conditionals, and abstractions Terraform makes painful (e.g. creating 50 Lambda functions with slight variations)
- You want to reuse infrastructure patterns as npm packages across projects
- You're building internal platform tools that embed infrastructure logic
Stay on Terraform if:
- Existing Terraform codebase > 1 year old
- Team is comfortable with HCL
- You use many Terraform modules from the registry (Pulumi has fewer)
- You need Terraform Cloud or Atlantis for team workflows (Pulumi Cloud exists but has less ecosystem)
The migration path:
Pulumi has a pulumi convert --from terraform command that converts HCL to TypeScript/Python — it's not perfect but handles ~70% of typical configs. Migrate module by module, not all at once.