
Pulumi Has a Free API: Infrastructure as Real Code, Not YAML
Terraform is HCL. CloudFormation is YAML. CDK generates JSON. Pulumi is actual TypeScript/Python/Go — with loops, conditions, and real abstractions. What Is Pulumi? Pulumi is an infrastructure-as-code platform where you define cloud resources in real programming languages — TypeScript, Python, Go, C#, Java, YAML. import * as pulumi from " @pulumi/pulumi " import * as aws from " @pulumi/aws " // Create a VPC const vpc = new aws . ec2 . Vpc ( " my-vpc " , { cidrBlock : " 10.0.0.0/16 " }) // Create subnets in a loop (try THIS in Terraform) const subnets = [ " 10.0.1.0/24 " , " 10.0.2.0/24 " , " 10.0.3.0/24 " ]. map (( cidr , i ) => new aws . ec2 . Subnet ( \ `subnet- \$ {i} \` , { vpcId: vpc.id, cidrBlock: cidr, availabilityZone: \` us-east-1 \$ {String.fromCharCode(97 + i)} \` , }) ) // S3 bucket const bucket = new aws.s3.Bucket("my-bucket", { versioning: { enabled: true }, }) // Lambda function const fn = new aws.lambda.Function("my-function", { runtime: "nodejs20.x", handler: "index.ha
Continue reading on Dev.to DevOps
Opens in a new tab



