
Pulumi Has a Free Infrastructure-as-Code Tool — Use TypeScript Instead of YAML
Terraform uses HCL. Pulumi uses TypeScript, Python, Go, or C#. Loops, conditionals, functions — real programming for real infrastructure. What is Pulumi? Pulumi is an infrastructure-as-code platform that lets you define cloud resources using general-purpose programming languages. No YAML, no HCL — just code you already know. Why Pulumi 1. Real Programming Languages import * as pulumi from " @pulumi/pulumi " ; import * as aws from " @pulumi/aws " ; // Create a VPC const vpc = new aws . ec2 . Vpc ( " main " , { cidrBlock : " 10.0.0.0/16 " }); // Create subnets with a loop const subnets = [ " a " , " b " , " c " ]. map (( az , i ) => new aws . ec2 . Subnet ( `subnet- ${ az } ` , { vpcId : vpc . id , cidrBlock : `10.0. ${ i } .0/24` , availabilityZone : `us-east-1 ${ az } ` , }) ); // Conditionally create resources if ( pulumi . getStack () === " production " ) { new aws . rds . Instance ( " db " , { engine : " postgres " , instanceClass : " db.r5.large " , allocatedStorage : 100 , vpcSecu
Continue reading on Dev.to DevOps
Opens in a new tab



