advanced

Pulumi

Use general-purpose languages such as TypeScript to declare infrastructure resources, stacks, configuration, and outputs.

Pulumi defines infrastructure with general-purpose languages such as TypeScript. JavaScript teams can reuse modules, types, tests, and package boundaries to model reusable infrastructure components.

					import * as aws from '@pulumi/aws';

const bucket = new aws.s3.Bucket('assets', {
  versioning: { enabled: true },
});

export const bucketName = bucket.id;
				

Stacks separate environments. `pulumi preview` shows planned changes before `pulumi up`. State and secret outputs still need protection like any IaC tool.

On interviews: stacks, previews, providers, outputs, secrets, dependency graphs, and language power versus review complexity.

Common pitfalls: imperative logic that makes plans unpredictable; secret outputs logged or committed; shared state across environments.

The trade-off is expressive TypeScript abstractions versus harder-to-read plans for reviewers.

Checklist:

  • Run previews before apply.
  • Model reusable components with clear interfaces.
  • Protect state and secret outputs.
  • Keep stack boundaries per environment.