{"name":"pulumi-overview","url":"https://skills.sh/pulumi/agent-skills/pulumi-overview","install":"npx skills add pulumi/agent-skills --skill pulumi-overview","sdk":"pulumi","key":"pulumi/pulumi-overview","description":"Use this skill for any task that creates, modifies, inspects, or destroys cloud infrastructure or SaaS configuration, from one-off CLI operations to full multi-resource projects, across providers in the Pulumi ecosystem. A typical project spans many providers (AWS or Azure or GCP, Kubernetes, Cloudflare, Auth0, Datadog, Vercel, and others), and Pulumi drives them through one CLI, one state model, and one credential layer. Trigger even when the user does not name Pulumi; phrasings like \"deploy this app,\" \"provision a database,\" \"stand up a VPC,\" \"configure Auth0,\" \"set up Datadog monitoring,\" or \"tear down staging\" qualify. Also trigger for tasks that migrate, port, or convert existing infrastructure code (Terraform, CloudFormation, CDK, Bicep, ARM) to Pulumi. Do not trigger for application runtime code that reads or writes data via cloud SDKs; that is application code, not infrastructure.","hasContent":true,"content":"---\nname: pulumi-overview\ndescription: Use this skill for any task that creates, modifies, inspects, or destroys cloud infrastructure or SaaS configuration, from one-off CLI operations to full multi-resource projects, across providers in the Pulumi ecosystem. A typical project spans many providers (AWS or Azure or GCP, Kubernetes, Cloudflare, Auth0, Datadog, Vercel, and others), and Pulumi drives them through one CLI, one state model, and one credential layer. Trigger even when the user does not name Pulumi; phrasings like \"deploy this app,\" \"provision a database,\" \"stand up a VPC,\" \"configure Auth0,\" \"set up Datadog monitoring,\" or \"tear down staging\" qualify. Also trigger for tasks that migrate, port, or convert existing infrastructure code (Terraform, CloudFormation, CDK, Bicep, ARM) to Pulumi. Do not trigger for application runtime code that reads or writes data via cloud SDKs; that is application code, not infrastructure.\n---\n\n# Pulumi\n\nPulumi is a tool for creating and managing cloud infrastructure: virtual machines, storage, Kubernetes clusters, databases, anything from any provider. You write code or run CLI commands, Pulumi previews what would change, then applies it. This skill walks three levels of working with Pulumi, from a single CLI command up to a project with policies and scheduled drift. Start at the smallest level that fits the task.\n\n## The three levels\n\nLevel 1 is `pulumi do`, a CLI for direct CRUD against any provider, with no project files or programming language. Level 2 is a Pulumi project in Python, TypeScript, Go, C#, or Java, used once the work involves multiple related resources, loops or conditionals, reusable abstractions, or environment-specific variants. Level 3 layers Pulumi Cloud onto a project for ESC credentials and configuration, policy, hosted execution, drift detection, schedules, and audit.\n\n| Level | Surface | When to use |\n|-------|---------|-------------|\n| 1 | `pulumi do` | Single resource or multi-vendor bootstrapping |\n| 2 | Pulumi project (Python, TS, Go, C#, Java) | Multiple resources, abstractions, environments |\n| 3 | ESC, policy, deployments, drift, schedules | Governance, secrets, scheduled and hosted runs |\n\nWhen the directory has no existing Pulumi project, a user asking to create a single bucket is a Level 1 task; do not scaffold a new project for it. A request to provision a VPC with subnets and a Kubernetes cluster is Level 2 from the start. A request for nightly drift detection on an existing stack is Level 3.\n\nConverting existing infrastructure code from another tool (Terraform, CloudFormation, CDK, ARM, or Bicep) is a separate path: route straight to the migration skills listed in the table at the end, independent of the level model.\n\nPicking the right level requires knowing what is already in the directory. If you can inspect the filesystem, do so. If you cannot (restricted agent contexts), ask the user before any Pulumi command runs whether there is an existing Pulumi project in the directory. Don't run a Pulumi command to find out: commands that would otherwise require a login silently provision a new agent account, parallel to one the user may already own.\n\n---\n\n## Level 1: `pulumi do` for direct resource operations\n\nUse `pulumi do` for one-shot resource operations against any provider. Examples: create a Cloudflare DNS record, create an S3 bucket for backups, create a GCP storage bucket for image uploads, stand up an Azure virtual machine, configure a Datadog monitor, register a Vercel deployment's domain in Cloudflare DNS. There is no project file, directory layout, or programming language involved.\n\n`pulumi do` is stateless. Each command runs once and operates directly against the cloud provider: `create` provisions a resource and prints its cloud-side identifier, while `read`, `patch`, and `delete` act on a resource addressed by that identifier. Nothing is written to a Pulumi state file, so there is no resource graph and no `${...}` wiring between commands. To connect two resources, capture an output from one command and pass it as a literal value to the next.\n\nWhen a Pulumi project (`Pulumi.yaml`) already exists in the directory, do not use `pulumi do` to mutate resources the project manages. Changes go through the program instead.\n\n### First invocation and signup\n\nThe canonical invocation is `npx pulumi <command>`. It works on any machine with Node.js installed and requires no prior Pulumi setup. If `pulumi` is on PATH, the `npx` shim defers to it; otherwise the command runs from the npm registry. To confirm the CLI is available before any command that would trigger signup, run `npx pulumi version`; it does not touch Pulumi Cloud. The resource verbs (`create`, `read`, `patch`, `delete`, `list`) require CLI v3.243.0 or newer, where `pulumi do` gained resource support. `npx pulumi` fetches a current release, but a `pulumi` already on PATH may be older, so confirm the version is recent.\n\n`pulumi do` writes no Pulumi state, but it resolves provider packages through the Pulumi registry, which can reach Pulumi Cloud. In an agent context without saved credentials, that means a first `pulumi do` may silently provision an ephemeral agent account and print a claim banner.\n\nThe CLI prints one line to stderr noting the new account and a claim URL. Surface that claim URL to the user immediately and again in the final response, since it is the only way the user takes ownership of the account; a session that ends without it leaves resources stranded in the cloud. The access token expires in 3 days and the claim URL stays valid for 30 days; Pulumi Cloud sets both, so surface whatever validity the banner reports.\n\nIf the account-creation banner appears more than once in the same session, credentials may not have been cached. Agent credentials are written to `/tmp/.pulumi/credentials.json` and the claim metadata to `/tmp/.pulumi/agent-claim.json`, but the claim URL itself is printed in the banner, not stored in those files. Capture it from each banner and surface the most recent one before doing more work.\n\nIf authentication fails, ask the user to run `pulumi login`. Never fall back to `pulumi login --local` or set `PULUMI_CONFIG_PASSPHRASE`; both silently change the user's setup.\n\nProvider credentials are separate from Pulumi Cloud credentials. `pulumi do` reads them from the same environment variables the provider's native CLI uses (`AWS_PROFILE`, `CLOUDFLARE_API_TOKEN`, `GOOGLE_APPLICATION_CREDENTIALS`). If they aren't set, ask the user before invoking commands that call out to the cloud. If a command fails with a provider authorization error, look up that provider's required credentials or configuration and have the user supply them rather than guessing at the cause. ESC (Level 3) is the durable place to keep them once a project exists.\n\n### Command shape\n\nHere are two invocations: create an S3 bucket, then read it back by the cloud id the create printed.\n\n```bash\nnpx pulumi do aws:s3:Bucket create --yes --bucket my-data\nnpx pulumi do aws:s3:Bucket read my-data\n```\n\nThe shape is:\n\n```text\npulumi do <pkg:mod:type> create [flags]\npulumi do <pkg:mod:type> read|patch|delete <id> [flags]\npulumi do <pkg:mod:type> list [flags]\n```\n\n- `<pkg>` is the provider package (`aws`, `azure-native`, `gcp`, `cloudflare`, `kubernetes`, etc.).\n- `<mod>` is the module within the package (`compute`, `storage`, `dns`); optional when the module is `index`. For example, `cloudflare:index/record:Record` invokes as `cloudflare:Record`.\n- `<type>` is the resource type (`VirtualMachine`, `Bucket`, `Record`).\n- `<id>` is the cloud provider's identifier for an existing resource, the value `create` prints as `id`. `create` and `list` take no positional argument; `read`, `patch`, and `delete` each take exactly one `<id>`.\n- `[flags]` set resource properties, or you pass a body file via `--input-file <file>`. See Property input below for how flags and files combine, and which values must come from a file.\n\nThere is no Pulumi logical name to choose. The CLI derives an internal name from the resource type, and you address existing resources by their cloud id.\n\n### Verbs\n\n- `create` provisions the resource and prints its properties, including the cloud `id`, as JSON. Capture that `id` to read, patch, or delete the resource later. Pass `--yes` in non-interactive contexts; `read` and `list` never need it.\n- `read <id>` fetches the resource's current state from the provider and prints it as JSON. It writes nothing.\n- `patch <id>` reads the resource's current inputs, overlays the top-level properties you pass as flags or in `--input-file`, and updates the resource in place. The overlay is shallow: properties you do not mention are left as they are. `patch` only updates; it cannot replace a resource, so a change that would require replacement fails rather than recreating it. The command makes you confirm by typing the resource id; pass `--yes` to skip that prompt in non-interactive contexts.\n- `delete <id>` removes the resource from the cloud. This is irreversible. Get explicit user confirmation for the specific resource before invoking; use `--yes` only after that confirmation, not as a default for non-interactive runs.\n\n`pulumi do` also supports two non-CRUD operations. `pulumi do <pkg:mod:type> list [flags]` enumerates existing instances of a resource type, but only for types that implement listing. Native providers support it broadly. The Terraform-bridged providers (`aws`, `azure`, `gcp`) support it too, but coverage varies by resource type, so a type that lacks it rejects the verb. `pulumi do <pkg:mod:function> [flags]` invokes a stateless function the provider exposes alongside its resources.\n\n### Property input\n\nProperties come from per-property flags, a body file, or both; flags overlay the body. Flags set top-level scalar properties only, so nested or structured values (`tags`, nested blocks) must come from the body file. The body defaults to PCL, written as flat `name = value` attributes; pass `--input yaml` (which needs the YAML converter plugin) to use YAML instead.\n\n```bash\ncat > bucket.pcl <<'EOF'\nbucket = \"my-data\"\ntags = {\n  Environment = \"dev\"\n}\nEOF\nnpx pulumi do aws:s3:Bucket create --yes --input-file bucket.pcl\n```\n\nBefore authoring properties for a resource new to this session, run `npx pulumi package info <pkg> --module <mod> --resource <Type>` to list its inputs and outputs with descriptions, scoped to that one resource. Reach for `npx pulumi package get-schema <pkg>` only when you need the full machine-readable schema with the nested type definitions `info` does not expand; for a large provider it runs to tens of MB, so do not read it whole. Property names are camelCase (flags are the kebab-case form). To discover names, run `npx pulumi package info <pkg>` with no module to list its modules and resources, or browse the catalog at https://www.pulumi.com/registry/.\n\n### Connecting resources\n\n`pulumi do` keeps no state and has no resource graph, so there is no `${...}` reference syntax between commands. To feed one resource's output into another, read a field from the first command's JSON output and pass it as a literal flag to the next.\n\n```bash\n# create prints JSON containing \"id\": \"vpc-0abc123\"\nnpx pulumi do aws:ec2:Vpc create --yes --cidr-block 10.0.0.0/16\n\n# pass that id to the subnet\nnpx pulumi do aws:ec2:Subnet create --yes --vpc-id vpc-0abc123 --cidr-block 10.0.1.0/24\n```\n\nThe same pattern connects resources across providers. Here a value from the `random` provider feeds an AWS resource name, a common way to get globally-unique names.\n\n```bash\n# RandomPet prints JSON containing \"id\": \"artistic-bull\"\nnpx pulumi do random:RandomPet create --yes\n\n# use it in the bucket name\nnpx pulumi do aws:s3:Bucket create --yes --bucket assets-artistic-bull\n```\n\nWhen a command needs a value the chain does not produce, like an existing resource id or an API zone id, get it from a provider function, a `list` where the provider supports it, or the user. Do not invent it.\n\n### Output\n\nBy default, `create`, `read`, and `patch` each write one JSON object to stdout for the affected resource. Check the exit code on every invocation.\n\n```json\n{\n  \"id\":     \"my-data\",\n  \"bucket\": \"my-data\",\n  \"arn\":    \"arn:aws:s3:::my-data\"\n}\n```\n\nThe resource's properties are top-level, alongside an `id` field holding the cloud identifier. There is no nested `outputs` object, no `urn`, and the type token you passed in is not echoed back. `list` instead writes a JSON array of `{id, name}` entries, and a function writes its declared result shape.\n\n### Graduating to Level 2\n\nEject to Level 2 when one-shot commands stop fitting. Because `pulumi do` leaves no Pulumi state behind, the resources it created are ordinary cloud resources, so you adopt them into a project with `pulumi import`. From inside a Pulumi project, run `pulumi import` with each resource's full type token, a logical name, and the cloud `id` that `create` returned. Import records the resource in the stack's state and, by default, generates its program code.\n\n```bash\n# the import type token is the full pkg:mod/type:Type form, not pulumi do's short aws:s3:Bucket\nnpx pulumi import aws:s3/bucket:Bucket assets my-data\n```\n\nMove the generated code into your program, then manage the resource there instead of with `pulumi do`. To adopt several at once, pass them in a bulk `--file`.\n\n---\n\n## Level 2: full infrastructure as code\n\nLevel 2 is a Pulumi project: code in Python, TypeScript, Go, C#, or Java that describes a set of related resources and their dependencies. Start here when the task involves multiple related resources, loops or conditionals, reusable abstractions, or environment-specific variants. It is also the right level when ad-hoc work at Level 1 has grown past what a few CLI invocations should carry. Match the user's existing codebase language when one is present; default to TypeScript otherwise.\n\nBefore writing any non-trivial program, use skill `pulumi-best-practices`, which covers `Output<T>` and `apply()` usage, passing outputs directly as inputs, component structure and parenting, secrets hygiene, and safe refactoring with `aliases`.\n\n### Bootstrapping\n\nThe quickest way to start a project is with a template, though you can scaffold one by hand if you prefer:\n\n```bash\nnpx pulumi new aws-typescript\nnpx pulumi new gcp-go\n```\n\nTemplates set up the working directory, `Pulumi.yaml`, an initial stack, the language's package manifest, and a starter program. Browse the full catalog with `npx pulumi template list`, or filter by name with `npx pulumi template list --name <filter>`.\n\n### Core lifecycle\n\nThe lifecycle commands work the same across languages:\n\n```bash\nnpx pulumi preview      # show what would change\nnpx pulumi up           # apply\nnpx pulumi refresh      # reconcile state with cloud reality\n```\n\nAlways run `preview` before `up`; it shows what will change and costs nothing.\n\n`pulumi destroy` tears down every resource in the stack. The Pulumi docs call it \"generally irreversible\"; never invoke without explicit user confirmation of the stack name.\n\n### Stacks and config\n\nA stack is an isolated instance of a project. A common pattern is one stack per environment, named `dev`, `staging`, and `prod`.\n\n```bash\nnpx pulumi stack init dev\nnpx pulumi stack select prod\n\nnpx pulumi config set aws:region us-west-2\nnpx pulumi config set --secret dbPassword \"...\"\n```\n\nRead configuration values from inside the program with the SDK's `Config` object; the exact operation names vary by language, so refer to the per-language examples at https://www.pulumi.com/docs/iac/concepts/config/#code. Use skill `pulumi-best-practices` for `Output<T>` / `apply()` usage and broader secrets hygiene.\n\nA stack only touches resources tracked in its state, so removing a resource from your program causes `pulumi up` to delete it from the cloud. Set `protect: true` on anything you cannot afford to lose.\n\nFor the full IaC reference, see https://www.pulumi.com/docs/iac/.\n\n---\n\n## Level 3: governance and operations\n\nLevel 3 uses Pulumi Cloud for more than state. ESC holds the credentials for every provider a project touches and brokers them into runs and shells. Policy enforcement, hosted execution, drift detection, scheduled operations, and audit round out the surface.\n\n### ESC: environments, secrets, configuration\n\nAn ESC environment composes secrets and configuration from cloud secret managers, OIDC-vended credentials, and other ESC environments into a single resolved bundle that programs and stacks consume.\n\n```bash\nnpx pulumi env init my_org/aws/prod\nnpx pulumi env set my_org/aws/prod aws.region us-west-2\nnpx pulumi env open my_org/aws/prod\nnpx pulumi env run my_org/aws/prod -- aws s3 ls\n```\n\n**Where the provider supports it, vend cloud credentials through OIDC rather than static keys in environment YAML.** OIDC trust policies, IdP registration, and rotation patterns live in `pulumi-esc`; use skill `pulumi-esc` rather than invent ESC YAML by hand.\n\n`env open` resolves and prints live credentials, so avoid capturing its output into logs or transcripts. Prefer `env run -- <command>`, which injects the credentials into the child process rather than printing them.\n\n### Policy\n\nPulumi Policies runs policy packs against the resource graph at preview and update time. A policy can reject the deployment, require approval, or annotate resources with findings; enforcement happens before any cloud API call.\n\n```bash\nnpx pulumi policy new aws-typescript          # scaffold a pack from a policy template\nnpx pulumi policy publish my_org              # the pack name comes from PulumiPolicy.yaml\nnpx pulumi policy enable my_org/<pack-name> latest --policy-group production\n```\n\nPolicies are written in TypeScript or Python, the same languages you use for programs.\n\n### Deployments\n\nPulumi Deployments runs `pulumi up`, `preview`, and `destroy` in Pulumi-managed infrastructure rather than on the local machine. Use it for CI without maintaining your own runners and for any operation that needs to run server-side.\n\n```bash\nnpx pulumi deployment run update --stack my_org/proj/prod\n```\n\nThe target stack must already exist; a wrong `--stack` value can prompt to create a new stack rather than fail.\n\n### Drift detection and scheduled operations\n\nDrift detection compares stack state against the cloud and reports anything that has diverged. For an ad-hoc local check, run a refresh in preview-only mode. Pulumi Cloud schedules operations on a cron (times are UTC), including a purpose-built drift kind.\n\n```bash\n# Ad-hoc local drift check\nnpx pulumi refresh --preview-only\n\n# Scheduled drift detection (detection only)\nnpx pulumi stack schedule new --kind drift --cron \"0 0 * * *\"\n\n# Scheduled secret rotation for an ESC environment\nnpx pulumi env schedule new my_org/aws/prod --cron \"0 0 1 * *\"\n```\n\nA schedule is standing automation that keeps running after the session ends, so confirm the operation, cadence, and stack with the user before creating one. Two kinds act without a human in the loop: `--kind drift --auto-remediate` runs `pulumi up` on detected drift, and `--kind ttl` destroys the stack at a set time. Default to detection-only unless the user asks for remediation.\n\n### Further reading\n\n- ESC: https://www.pulumi.com/docs/esc/\n- Pulumi Policies: https://www.pulumi.com/docs/insights/policy/\n- Deployments: https://www.pulumi.com/docs/pulumi-cloud/deployments/\n- Drift detection: https://www.pulumi.com/docs/pulumi-cloud/deployments/drift/\n\n---\n\n## Reference\n\nWhen you are uncertain about a CLI flag, command shape, or resource property, look it up rather than guess. `npx pulumi <command> --help` documents every flag and subcommand from the CLI itself. The full reference, provider catalog, and conceptual documentation live at https://www.pulumi.com/docs.\n\n---\n\n## Routing to specialized skills\n\nWhen the work moves into territory another skill covers in depth, hand off to that skill rather than reinvent its content.\n\n| Skill | Load when |\n|---|---|\n| `pulumi-best-practices` | Writing any non-trivial Level 2 program |\n| `pulumi-component` | Packaging or consuming `ComponentResource` abstractions |\n| `pulumi-esc` | Defining ESC environments, OIDC trust policies, or rotation |\n| `pulumi-automation-api` | Embedding Pulumi inside another program (IDP, custom CI) |\n| `provider-upgrade` | Upgrading a provider package version in a stack without unintended changes |\n| `package-usage` | Auditing which stacks across the org use a package and at what versions |\n| `pulumi-terraform-to-pulumi`, `pulumi-cdk-to-pulumi`, `cloudformation-to-pulumi`, `pulumi-arm-to-pulumi` | Migrating from those tools |\n\nAn agent only sees the skills the user installed, so a referenced skill may not be present. `pulumi-best-practices`, `pulumi-component`, `pulumi-esc`, `pulumi-automation-api`, `provider-upgrade`, and `package-usage` ship in the same `pulumi` plugin as this skill, so they are available whenever this one is. The migration skills install separately through the `pulumi-migration` plugin and may be absent. When a referenced skill is available, load it. When it is not, do not stall or treat the gap as an error: continue with the guidance in this skill and the docs at https://www.pulumi.com/docs, and tell the user which skill or plugin covers the work in depth.\n","contentSource":"skills.sh/api/download/pulumi/agent-skills/pulumi-overview","contentFetchedAt":"2026-07-27T08:59:34.732Z"}