Package Usage

pulumi/agent-skills/pulumi/skills/package-usage

作者 pulumi900eacf4444f无许可证70 个星标收录于 2026年10月8日更新于 2026年10月8日仓库昨天更新

Track which stacks across a Pulumi organization use a specific package and at what versions. Use for cross-stack audits, identifying outdated or unmaintained package versions across many stacks, finding affected stacks before publishing breaking changes to a component package, or planning coordinated upgrade rollouts. Do NOT use for upgrading a cloud provider package (pulumi-aws, pulumi-azure-native, pulumi-gcp, pulumi-kubernetes, etc.) in a single project — use skill `provider-upgrade` instead. Do NOT use for general infrastructure creation, resource provisioning, or how-to questions about a package.

仅含说明DevOps & Cloud
AI 生成的概览

审计哪些 Pulumi 堆栈使用了某个包及其版本,并标记过期的堆栈。

功能
通过 pulumi api CLI 查询 Pulumi Cloud API,获取某个包的最新版本以及组织内使用该包的堆栈。它将每个堆栈的版本与最新版本比较,并输出包含项目、堆栈、当前版本、最新版本和状态的 Markdown 表格,以及汇总计数。它只识别过期堆栈,不执行升级。
适用场景
适用于跨堆栈的包版本审计、查找众多堆栈中过期或无人维护的版本、在发布组件包破坏性变更前定位受影响的堆栈,或规划协调一致的升级推广。
运行要求
需要 pulumi CLI、现有的 Pulumi Cloud 凭据、访问 Pulumi Cloud API 的网络连接,以及组织名称。不附带脚本。

API Reference

Query the Pulumi Cloud API with the pulumi api CLI subcommand. It authenticates with your existing Pulumi credentials and returns JSON.

Get the latest version of a package

pulumi api /api/registry/packages -F name={package_name} -F orgLogin={orgName}

Include orgLogin with the user's organization name. Omit -F name=... to list all packages visible to the organization (useful when the user has not named a specific package). The response contains a packages array. Each entry has a version field (the latest version), plus name, publisher, source, and packageStatus.

Get stack usage for a package

pulumi api /api/orgs/{orgName}/packages/usage -F packageName={package_name}

Replace {orgName} with the org name from context, PULUMI_ORG, or ask the user. packageName is required; query one package at a time.

Response fields:

  • packageName: The queried package
  • stacks: Array of {stackName, projectName, version, lastUpdate}
  • totalStacks: Total count

Workflow: Find outdated stacks

Use when the user wants to know which stacks are using an outdated version of a package.

  1. Get the latest version of the package
  2. Get stack usage for the package
  3. Compare each stack's version against the latest to identify outdated stacks
  4. Present results using the output format below

Output Format

Present results as a markdown table followed by a summary line:

| Project | Stack | Current Version | Latest Version | Status ||---------|-------|-----------------|----------------|--------|| my-app  | dev   | 6.40.0          | 6.52.0         | Outdated || my-app  | prod  | 6.52.0          | 6.52.0         | Up-to-date |
2 of 2 stacks checked. 1 outdated.

Out of scope: upgrading a specific stack

This skill identifies outdated stacks. It does not perform the upgrade itself. For actually bumping a package version in a project — editing package.json, requirements.txt, pyproject.toml, go.mod, or Pulumi.yaml, running pulumi preview, and reconciling the diff — hand off to the provider-upgrade skill.

来源与署名

来源:pulumi/agent-skills位于pulumi/skills/package-usage提交900eacf

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架