Pulumi
Overview
Pulumi enables defining and managing cloud infrastructure using real programming languages (TypeScript, Python, Go, C#) instead of domain-specific languages. It supports 150+ cloud providers and allows using loops, conditionals, classes, and packages to build reusable, testable infrastructure components.
Instructions
- When creating resources, declare them as objects (e.g.,
new aws.s3.Bucket("my-bucket", {...})) and use pulumi.Output<T> with .apply() for computed values from cloud API responses.
- When managing environments, use stacks (
pulumi stack init dev/staging/prod) with stack-specific config for instance sizes, replica counts, and feature flags.
- When handling secrets, always use
pulumi config set --secret for credentials and never hardcode secrets in code.
- When building reusable patterns, create Component Resources by extending
pulumi.ComponentResource to encapsulate common infrastructure patterns (VPC module, ECS service, etc.).
- When referencing across projects, use Stack References to read outputs from other stacks for cross-project dependencies.
- When enforcing compliance, use CrossGuard policies to prevent non-compliant resources (e.g., no public S3 buckets, require encryption) in CI.
- When testing, write unit tests for Component Resources using standard test frameworks (Vitest, pytest, go test) by mocking the cloud provider and asserting resource properties.
Examples
Example 1: Deploy a serverless API on AWS
User request: "Set up an AWS Lambda API with DynamoDB using Pulumi and TypeScript"
Actions:
- Scaffold project with
pulumi new aws-typescript
- Define DynamoDB table and Lambda function resources
- Create API Gateway routes linked to Lambda handlers
- Export endpoint URL as a stack output for consumption
Output: A serverless API with infrastructure defined and deployed via pulumi up.
Example 2: Create a reusable VPC component
User request: "Build a reusable VPC module with Pulumi that teams can share"
Actions:
- Create a Component Resource class extending
pulumi.ComponentResource
- Define VPC, subnets, route tables, and NAT gateway as child resources
- Expose outputs for subnet IDs and security group references
- Write unit tests mocking AWS provider to validate configuration
Output: A reusable infrastructure component that teams import as a package.
Guidelines
- Use Component Resources for reusable patterns; do not repeat VPC/ECS/RDS configs across stacks.
- Always use
pulumi config set --secret for credentials; never hardcode secrets in code.
- Name resources with the project and stack for unique identification across environments.
- Export important outputs (URLs, endpoints, ARNs) for cross-stack consumption.
- Write unit tests for Component Resources by mocking the cloud provider and asserting resource properties.
- Use stack-specific config for environment differences: instance sizes, replica counts, feature flags.
- Enable CrossGuard policies in CI to prevent non-compliant resources from being deployed.
1---2name: pulumi3description: >-4 Assists with defining and managing cloud infrastructure using Pulumi with TypeScript, Python,5 Go, or C#. Use when provisioning AWS, GCP, Azure, or Kubernetes resources with real programming6 languages instead of HCL. Trigger words: pulumi, infrastructure as code, iac, pulumi up,7 pulumi stack, cloud infrastructure, component resource.8license: Apache-2.09compatibility: "Requires Pulumi CLI and a supported language runtime (Node.js, Python, Go, .NET)"10metadata:11 source: https://skillmd.com/skills/eliferjunior/pulumi12 author: terminal-skills13 version: "1.0.0"14 category: devops15 tags: ["pulumi", "infrastructure-as-code", "cloud", "devops", "multi-cloud"]16---1718# Pulumi1920## Overview2122Pulumi enables defining and managing cloud infrastructure using real programming languages (TypeScript, Python, Go, C#) instead of domain-specific languages. It supports 150+ cloud providers and allows using loops, conditionals, classes, and packages to build reusable, testable infrastructure components.2324## Instructions2526- When creating resources, declare them as objects (e.g., `new aws.s3.Bucket("my-bucket", {...})`) and use `pulumi.Output<T>` with `.apply()` for computed values from cloud API responses.27- When managing environments, use stacks (`pulumi stack init dev/staging/prod`) with stack-specific config for instance sizes, replica counts, and feature flags.28- When handling secrets, always use `pulumi config set --secret` for credentials and never hardcode secrets in code.29- When building reusable patterns, create Component Resources by extending `pulumi.ComponentResource` to encapsulate common infrastructure patterns (VPC module, ECS service, etc.).30- When referencing across projects, use Stack References to read outputs from other stacks for cross-project dependencies.31- When enforcing compliance, use CrossGuard policies to prevent non-compliant resources (e.g., no public S3 buckets, require encryption) in CI.32- When testing, write unit tests for Component Resources using standard test frameworks (Vitest, pytest, go test) by mocking the cloud provider and asserting resource properties.3334## Examples3536### Example 1: Deploy a serverless API on AWS3738**User request:** "Set up an AWS Lambda API with DynamoDB using Pulumi and TypeScript"3940**Actions:**411. Scaffold project with `pulumi new aws-typescript`422. Define DynamoDB table and Lambda function resources433. Create API Gateway routes linked to Lambda handlers444. Export endpoint URL as a stack output for consumption4546**Output:** A serverless API with infrastructure defined and deployed via `pulumi up`.4748### Example 2: Create a reusable VPC component4950**User request:** "Build a reusable VPC module with Pulumi that teams can share"5152**Actions:**531. Create a Component Resource class extending `pulumi.ComponentResource`542. Define VPC, subnets, route tables, and NAT gateway as child resources553. Expose outputs for subnet IDs and security group references564. Write unit tests mocking AWS provider to validate configuration5758**Output:** A reusable infrastructure component that teams import as a package.5960## Guidelines6162- Use Component Resources for reusable patterns; do not repeat VPC/ECS/RDS configs across stacks.63- Always use `pulumi config set --secret` for credentials; never hardcode secrets in code.64- Name resources with the project and stack for unique identification across environments.65- Export important outputs (URLs, endpoints, ARNs) for cross-stack consumption.66- Write unit tests for Component Resources by mocking the cloud provider and asserting resource properties.67- Use stack-specific config for environment differences: instance sizes, replica counts, feature flags.68- Enable CrossGuard policies in CI to prevent non-compliant resources from being deployed.