All skills
pulumi avatar

/provider-upgrade

@fbeac07 official
by pulumipulumi/agent-skills70 stars
6

Upgrade any Pulumi provider to a newer version and reconcile the resulting diff. Use when users want to upgrade or update a provider (including editing package.json, requirements.txt, pyproject.toml, go.mod, or Pulumi.yaml to bump a provider SDK), check for breaking changes before or during an upgrade, fix resources that broke after a provider upgrade, or resolve unexpected replacements, creates, or deletes in a post-upgrade preview. Applies to all providers (aws, azure-native, gcp, kubernetes, aws-native, cloudflare, datadog, etc.) — not just Tier 1. Do NOT use for querying which stacks use what package versions; use skill `package-usage` for cross-stack audits. Do NOT use for general infrastructure tasks.

Use this Skill: https://skilld.dev/gh/pulumi/agent-skills/provider-upgrade

This session only. Nothing lands on disk.

referencesdiagnostic-toolbox.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Diagnostic Toolbox

Use these tools to investigate diffs - especially Category B diffs (resources you didn't change code for). Reach for whichever tool fits the situation.

For major version upgrades, check the upgrade guide early - even alongside the first preview. Upgrade guides contain sequencing requirements and edge cases that no other tool can surface.

Upgrade Guide (Pulumi or Terraform)

The most valuable resource for major version bumps. Contains migration patterns, sequencing requirements, and documents which diffs are known preview artifacts.

The upgrade guide is the ONLY authoritative source for classifying a diff as a "known no-op" - a diff that shows in preview but resolves on pulumi up without affecting real infrastructure.

Pulumi upgrade guide: Search for site:pulumi.com {provider} migration guide v{major}.

Terraform upgrade guide (for Terraform-based providers): Check https://registry.terraform.io/providers/{org}/{tf-provider}/latest/docs/guides/version-{major}-upgrade or search for site:registry.terraform.io {tf-provider} version {major} upgrade.

When to use: For any major version upgrade. Check it early.

schema-tools - structured diff between versions

A structured diff of every schema change between provider versions. For large providers, the diff can contain thousands of changes - always cross-reference with the resource types actually present in the stack.

Install (if not available):

This example is intentionally lightweight and may drift over time. If the pinned version below is stale, use the latest available schema-tools release instead of treating the example version as authoritative.

OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64|arm64) ARCH="arm64" ;; esac
VERSION="v0.7.0"
curl -fsSL "https://github.com/pulumi/schema-tools/releases/download/${VERSION}/schema-tools-${VERSION}-${OS}-${ARCH}.tar.gz" \
  -o /tmp/schema-tools.tar.gz
tar -xzf /tmp/schema-tools.tar.gz -C /tmp/
chmod +x /tmp/schema-tools

Run and save to a file:

/tmp/schema-tools compare -p {provider} -o v{current_version} -n v{target_version} --json > /tmp/{provider}-schema-diff.json

The -o and -n flags must be full version tags (e.g., v6.0.0, v7.0.0), not just major numbers. Use the exact versions from the lockfile.

Useful queries:

# Summary of all breaking change categories
jq '.summary' /tmp/{provider}-schema-diff.json

# Changes for a specific resource
jq '.grouped.resources["aws:s3/bucket:Bucket"]' /tmp/{provider}-schema-diff.json

# All changes of a specific type
jq '[.changes[] | select(.kind == "missing-input")]' /tmp/{provider}-schema-diff.json

# All breaking changes matching a pattern
jq '[.changes[] | select(.token | test("apigateway"))]' /tmp/{provider}-schema-diff.json

# List all affected resource tokens
jq '[.changes[] | .token] | unique' /tmp/{provider}-schema-diff.json

Each change entry has kind, token, severity, and message fields. The change kinds you'll encounter most often during upgrades:

  • missing-input - a property was removed from inputs. Usually renamed or replaced by a different property with a different shape. The schema diff says it's gone but doesn't say what replaced it - check the upgrade guide or new schema for the replacement.
  • type-changed - a property's type changed. The most common pattern is a MaxItemsOne flip: a property is renamed AND changes between single object and array (or vice versa). Example: certificateAuthorities (array) -> certificateAuthority (single object).
  • token-remapped - a resource or function was renamed. If "deprecated," the old name still works (don't chase it). If "remapped," the old name is gone - rename in code and add an alias to preserve state: aliases: [{ type: "old:token:Name" }].

When to use: When preview errors mention unknown properties, missing fields, type mismatches, or unrecognized resource types. The schema diff tells you exactly what was renamed, removed, or reshaped.

Stack state inspection - scope changes to this stack

Inspect the stack's deployed resource types. Essential for large providers - filter the schema diff to only resources that matter. Use whatever state inspection tooling is available in the environment, such as pulumi stack --show-urns, pulumi stack export, state files, or backend resource inventory APIs.

# Example: list resource types from a stack export
pulumi stack export > /tmp/stack.json
jq -r '.deployment.resources[].type' /tmp/stack.json | sort -u

# Then filter schema diff to only resource types in the stack
jq '[.changes[] | select(.token | test("ZoneSettingsOverride|PageRule|Record|Zone"))]' \
  /tmp/{provider}-schema-diff.json

When to use: Always use alongside schema-tools.

SDK type definitions - inspect the new API shape

For TypeScript and Python projects, the installed package's type definitions show the exact new API - property names, types, required vs. optional.

TypeScript: read node_modules/@pulumi/{provider}/*.d.ts for the resource type Python: read the installed package source

Faster than schema-tools for answering "what does this resource look like now?"

GitHub issues

Search pulumi/pulumi-{provider} and hashicorp/terraform-provider-{tf-name} for specific error messages or resource names.

When to use: When upgrade guides don't cover an edge case, or when you're seeing unexpected behavior that might be a known bug.

Source: SKILL.md on GitHub

1 warning17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill is safe. It provides a structured workflow for upgrading Pulumi provider versions by managing dependencies, running previews, and reconciling state changes. It correctly references official Pulumi tools and documentation. The external utility `schema-tools` is fetched from the official Pulumi GitHub repository, which is a trusted source.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: MEDIUM · 1 issue

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at fbeac07. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 6 months ago
  • pulumi
  • provider-upgrade
  • infrastructure-as-code
  • aws
  • azure
  • gcp
  • kubernetes
  • state-management
  • breaking-changes

README badge

README badge for pulumi/agent-skills/provider-upgrade

Upgrades a Pulumi provider to a newer version by updating dependencies, running previews with required flags, and systematically resolving diffs through code translation and state reconciliation. Covers all providers (aws, azure-native, gcp, kubernetes, cloudflare, datadog, etc.) and categorizes diffs to distinguish code changes from provider behavior changes.

Generated from the current SKILL.md.

What does this skill do during a provider upgrade?
It guides you through upgrading a Pulumi provider to a newer version by bumping the dependency, running previews with required CLI flags, categorizing all resource diffs, and fixing translations until the preview shows no unexpected changes. The goal is a zero-diff upgrade where the code correctly expresses the same infrastructure intent in the new provider's API.
Should I run `pulumi up` after upgrading?
No. Provider upgrades require code review before deployment. Make your code changes, verify with preview, create a PR for review, and deploy via CI/CD after merge.
What CLI flags do I need when previewing?
Always use `pulumi preview --refresh --run-program` when checking an upgrade. These flags refresh actual cloud state and run your program during the preview; without them you'll see false diffs that aren't real.
What should I do if a resource shows `delete` in the preview?
Never accept a `delete` in the final preview — it means `pulumi up` will destroy real cloud infrastructure. Either fix the diff via code changes, use `pulumi state delete` to manually remove from tracking, or document it as a manual step for the user. A delete cannot remain when you create the PR.
When should I use `import` instead of accepting a `create` diff?
When a new resource block represents infrastructure that already exists in the cloud and was managed implicitly in the old provider version. Import tells Pulumi to adopt the existing cloud resource instead of creating duplicate infrastructure.

Generated from the current SKILL.md. These answers refresh after source changes.