Cloud Intermediate
Pulumi Tutorial — IaC in a Programming Language¶
PulumiIaCTypeScript 3 min read
Infrastructure as Code in TypeScript, Python or Go. An alternative to Terraform.
Why Pulumi?¶
Infrastructure in a real programming language — loops, conditions, tests, IDE support.
Example in TypeScript¶
import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";
const bucket = new aws.s3.Bucket("my-bucket", {
website: { indexDocument: "index.html" }
});
const bucketPolicy = new aws.s3.BucketPolicy("policy", {
bucket: bucket.id,
policy: bucket.arn.apply(arn => JSON.stringify({
Statement: [{
Effect: "Allow",
Principal: "*",
Action: "s3:GetObject",
Resource: \`\${arn}/*\`
}]
}))
});
export const url = bucket.websiteEndpoint;
Summary¶
Pulumi = Terraform for developers. The full power of a programming language for infrastructure. Consider it if HCL limits you.
Need Help with Implementation?¶
Our team has experience designing and implementing modern architectures. We’re happy to help.