@punks/cli 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BASELINE_CHANGELOG.md +24 -0
- package/dist/CHANGELOG.md +31 -0
- package/dist/index.js +95 -6
- package/dist/skills/agnostic/backend/backend-domain-structure/SKILL.md +18 -6
- package/dist/skills/agnostic/backend/backend-domain-structure/references/layout.md +61 -3
- package/dist/skills/frameworks/pulumi/package-usage/SKILL.md +49 -0
- package/dist/skills/frameworks/pulumi/package-usage/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/pulumi/package-usage/use_cases.yaml +15 -0
- package/dist/skills/frameworks/pulumi/provider-upgrade/SKILL.md +332 -0
- package/dist/skills/frameworks/pulumi/provider-upgrade/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/pulumi/provider-upgrade/references/diagnostic-toolbox.md +131 -0
- package/dist/skills/frameworks/pulumi/provider-upgrade/use_cases.yaml +28 -0
- package/dist/skills/frameworks/pulumi/pulumi-automation-api/SKILL.md +320 -0
- package/dist/skills/frameworks/pulumi/pulumi-automation-api/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/pulumi/pulumi-automation-api/use_cases.yaml +7 -0
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/SKILL.md +501 -0
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/pulumi/pulumi-best-practices/use_cases.yaml +7 -0
- package/dist/skills/frameworks/pulumi/pulumi-component/SKILL.md +830 -0
- package/dist/skills/frameworks/pulumi/pulumi-component/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/pulumi/pulumi-component/use_cases.yaml +19 -0
- package/dist/skills/frameworks/pulumi/pulumi-esc/SKILL.md +281 -0
- package/dist/skills/frameworks/pulumi/pulumi-esc/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/pulumi/pulumi-esc/use_cases.yaml +30 -0
- package/dist/skills/frameworks/pulumi/pulumi-overview/SKILL.md +289 -0
- package/dist/skills/frameworks/pulumi/pulumi-overview/use_cases.yaml +50 -0
- package/dist/skills/phases/goalify/SKILL.md +18 -54
- package/package.json +1 -1
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: provider-upgrade
|
|
3
|
+
description: >
|
|
4
|
+
Upgrade any Pulumi provider to a newer version and reconcile the resulting diff. Use when
|
|
5
|
+
users want to upgrade or update a provider (including editing package.json, requirements.txt,
|
|
6
|
+
pyproject.toml, go.mod, or Pulumi.yaml to bump a provider SDK), check for breaking changes
|
|
7
|
+
before or during an upgrade, fix resources that broke after a provider upgrade, or resolve
|
|
8
|
+
unexpected replacements, creates, or deletes in a post-upgrade preview. Applies to all
|
|
9
|
+
providers (aws, azure-native, gcp, kubernetes, aws-native, cloudflare, datadog, etc.) — not
|
|
10
|
+
just Tier 1. Do NOT use for querying which stacks use what package versions; use skill
|
|
11
|
+
`package-usage` for cross-stack audits. Do NOT use for general infrastructure tasks.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Upgrading Pulumi Providers
|
|
15
|
+
|
|
16
|
+
## The Principle
|
|
17
|
+
|
|
18
|
+
A provider upgrade is a translation, not a change request.
|
|
19
|
+
|
|
20
|
+
The user's infrastructure intent hasn't changed - they still want the same bucket, the
|
|
21
|
+
same function, the same cluster. What changed is how the provider's API expresses that
|
|
22
|
+
intent. Your job is to translate their existing code into the new API so that Pulumi sees
|
|
23
|
+
no difference between what the code says and what already exists.
|
|
24
|
+
|
|
25
|
+
There are four layers to keep in mind:
|
|
26
|
+
|
|
27
|
+
1. **User intent** - what the user wants in the cloud (unchanged during an upgrade)
|
|
28
|
+
2. **Code** - how the program expresses that intent using the provider API (may need updating)
|
|
29
|
+
3. **Pulumi state** - Pulumi's stored representation of what exists (may need reconciliation)
|
|
30
|
+
4. **Real cloud** - the actual infrastructure (should not change during an upgrade)
|
|
31
|
+
|
|
32
|
+
During an upgrade, layers 2 and 3 may need to change so that they continue to correctly
|
|
33
|
+
represent the unchanged layers 1 and 4.
|
|
34
|
+
|
|
35
|
+
A correct translation produces zero diff. The Pulumi engine doesn't have a concept of
|
|
36
|
+
"upgrade" - it just compares goal state (your code) against actual state (the state file)
|
|
37
|
+
and reconciles. If the translation is correct, those two states match and nothing happens.
|
|
38
|
+
If you see a diff, either your translation is wrong, or something beyond a code change is
|
|
39
|
+
needed (import, alias, manual step). In all cases, the diff is a problem to solve, not a
|
|
40
|
+
consequence to accept.
|
|
41
|
+
|
|
42
|
+
## The Core Loop
|
|
43
|
+
|
|
44
|
+
```mermaid
|
|
45
|
+
flowchart TD
|
|
46
|
+
A[Bump version] --> B[Run preview with env vars]
|
|
47
|
+
B --> C{Clean?}
|
|
48
|
+
C -->|Yes| D[Create PR]
|
|
49
|
+
C -->|No| E[Diff Checkpoint: categorize every diff]
|
|
50
|
+
E --> F{Any Category A?}
|
|
51
|
+
F -->|Yes| G[Fix wrong translations]
|
|
52
|
+
G --> B
|
|
53
|
+
F -->|No| H{Any Category B?}
|
|
54
|
+
H -->|Yes| I[Investigate with toolbox]
|
|
55
|
+
I --> J[Fix or document]
|
|
56
|
+
J --> B
|
|
57
|
+
H -->|No| D
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
1. **Bump** the provider dependency
|
|
61
|
+
2. **Preview** with required CLI flags
|
|
62
|
+
3. **Diff Checkpoint** - categorize every non-`same` resource (see next section)
|
|
63
|
+
4. **Fix Category A** - code changes that didn't produce `same`
|
|
64
|
+
5. **Investigate Category B** - diffs on resources you didn't change
|
|
65
|
+
6. **Repeat** until clean or remaining diffs are fully investigated
|
|
66
|
+
7. **Create PR** with upgrade summary
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## The Diff Checkpoint
|
|
71
|
+
|
|
72
|
+
This is the most important section. Run this after EVERY preview.
|
|
73
|
+
|
|
74
|
+
For each non-`same` resource, answer one question:
|
|
75
|
+
**"Did any of my code changes affect this resource - directly or indirectly?"**
|
|
76
|
+
|
|
77
|
+
"Directly" means you edited the resource block itself. "Indirectly" means you changed
|
|
78
|
+
something that feeds into this resource - a shared variable, an output from another
|
|
79
|
+
resource, a helper function, a default value, or a resource that this one depends on.
|
|
80
|
+
If your changes could have altered what Pulumi computes for this resource, it's Category A.
|
|
81
|
+
|
|
82
|
+
Then follow the category that applies.
|
|
83
|
+
|
|
84
|
+
### Category A: I changed code for this resource
|
|
85
|
+
|
|
86
|
+
Your code change was supposed to translate the same intent into the new API. If the
|
|
87
|
+
resource shows `same`, your translation is correct. If it shows anything else, your
|
|
88
|
+
translation is wrong. Not "the diff is expected because I changed the code" - if the
|
|
89
|
+
change were semantically equivalent, there would be no diff.
|
|
90
|
+
|
|
91
|
+
**I modified an existing resource and it shows `update`:**
|
|
92
|
+
|
|
93
|
+
Your rename, restructure, or value adjustment changed the meaning, not just the syntax.
|
|
94
|
+
The resource would show `same` if the old and new code compiled to the same goal state.
|
|
95
|
+
The `update` means they don't.
|
|
96
|
+
|
|
97
|
+
Ask yourself: *"If this rename were truly equivalent, the resource would show `same`.
|
|
98
|
+
It doesn't. What is semantically different between my old code and my new code?"*
|
|
99
|
+
|
|
100
|
+
Common causes: the new property name maps to a different underlying field; the value
|
|
101
|
+
shape changed and your conversion lost or added information; a default value changed
|
|
102
|
+
in the new version and you need to explicitly set the old value; additional properties
|
|
103
|
+
now appear in the diff because the new provider version tracks fields it didn't before
|
|
104
|
+
(these need to be set explicitly to match the current state).
|
|
105
|
+
|
|
106
|
+
If the update includes properties you didn't change - new fields appearing, type
|
|
107
|
+
normalizations (string->number), additional defaults - that's the provider changing what
|
|
108
|
+
it tracks. But if the diff is there, `pulumi up` WILL send those values to the cloud API.
|
|
109
|
+
Don't assume they're no-ops. Investigate each changed property.
|
|
110
|
+
|
|
111
|
+
**I added a new resource block and it shows `create`:**
|
|
112
|
+
|
|
113
|
+
During an upgrade, a new resource block almost always represents infrastructure that
|
|
114
|
+
already exists in the cloud. The old provider managed it implicitly (as part of another
|
|
115
|
+
resource); the new provider needs an explicit resource. But the cloud object is already
|
|
116
|
+
there. Pulumi wants to create NEW infrastructure - that's not what you want.
|
|
117
|
+
|
|
118
|
+
The fix is `import`, not `create`. Tell Pulumi to adopt the existing cloud resource.
|
|
119
|
+
|
|
120
|
+
Ask yourself: *"What cloud object does this new resource represent? Does it already
|
|
121
|
+
exist? How was it managed before the upgrade?"*
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
// Wrong - creates duplicate infrastructure
|
|
125
|
+
const stage = new aws.apigateway.Stage("prodStage", { ... });
|
|
126
|
+
|
|
127
|
+
// Right - adopts the existing resource
|
|
128
|
+
const stage = new aws.apigateway.Stage("prodStage", { ... }, {
|
|
129
|
+
import: "<rest-api-id>/prod", // import ID format varies by resource type
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**I removed a resource block and it shows `delete`:**
|
|
134
|
+
|
|
135
|
+
A `delete` in the preview means `pulumi up` will call the provider's Delete API to
|
|
136
|
+
destroy or unconfigure this cloud resource. This is real destruction - not just state
|
|
137
|
+
cleanup. The cloud infrastructure still exists and is almost certainly still needed.
|
|
138
|
+
|
|
139
|
+
This is different from `pulumi state delete`, which removes the resource from Pulumi's
|
|
140
|
+
tracking WITHOUT calling the provider's API. When a resource type is removed in a new
|
|
141
|
+
provider version, the correct approach is:
|
|
142
|
+
1. `pulumi state delete '<urn>'` - manual step, removes from tracking only
|
|
143
|
+
2. Add replacement resources (if any) with imports - adopts the cloud state under new types
|
|
144
|
+
3. Verify with preview
|
|
145
|
+
|
|
146
|
+
Do NOT leave a `delete` in the preview and proceed to PR creation. A delete that runs
|
|
147
|
+
via `pulumi up` will destroy real infrastructure. If the resource must be removed from
|
|
148
|
+
state, document it as a manual step for the user.
|
|
149
|
+
|
|
150
|
+
Ask yourself: *"What cloud infrastructure does this resource manage? If `pulumi up` runs
|
|
151
|
+
this delete, what gets destroyed or unconfigured?"*
|
|
152
|
+
|
|
153
|
+
### Category B: I didn't change code for this resource
|
|
154
|
+
|
|
155
|
+
This diff was not caused by your code changes. It comes from the provider version change
|
|
156
|
+
itself - a different default, a changed state representation, or a behavioral difference.
|
|
157
|
+
Read `references/diagnostic-toolbox.md` and investigate.
|
|
158
|
+
|
|
159
|
+
These diffs might be:
|
|
160
|
+
- **Fixable with code** - set an explicit value for a changed default, add an alias
|
|
161
|
+
- **A documented no-op** - the upgrade guide says it resolves on `pulumi up` without
|
|
162
|
+
affecting real infrastructure. This classification REQUIRES a citation from the upgrade
|
|
163
|
+
guide or provider documentation. Your own judgment that "this looks like a no-op" is
|
|
164
|
+
not sufficient - the user is trusting you to distinguish real infrastructure changes
|
|
165
|
+
from artifacts, and getting it wrong means unexpected changes to their cloud.
|
|
166
|
+
- **Requiring manual steps** - state removal + reimport, documented for the user
|
|
167
|
+
- **Unknown** - present what you've found to the user and ask for guidance
|
|
168
|
+
|
|
169
|
+
### Category C: Provider version bump
|
|
170
|
+
|
|
171
|
+
An `update` on `pulumi:providers:{name}` showing only a version change is the one
|
|
172
|
+
expected diff. Verify no other properties changed on the provider resource.
|
|
173
|
+
|
|
174
|
+
### After categorizing
|
|
175
|
+
|
|
176
|
+
**Completeness check:** Every resource in the preview that shows any non-`same` state
|
|
177
|
+
must appear in your checkpoint - including resources with `[diff: ...]` annotations,
|
|
178
|
+
even if they don't have an explicit create/update/delete marker. If you didn't list it,
|
|
179
|
+
your checkpoint is incomplete. Go back and categorize the missing resources.
|
|
180
|
+
|
|
181
|
+
**Evidence requirement for accepted diffs:** If you want to accept any diff as "OK"
|
|
182
|
+
(not fix it), you need evidence - whether it's Category A or Category B. "I believe the
|
|
183
|
+
API treats these equivalently" or "this looks like state reconciliation" is not evidence.
|
|
184
|
+
Acceptable evidence: the upgrade guide documents it, a GitHub issue confirms it, or the
|
|
185
|
+
provider documentation explains the behavior. If you can't find evidence, either fix the
|
|
186
|
+
diff or flag it to the user.
|
|
187
|
+
|
|
188
|
+
**Ordering:** Fix all Category A issues before investigating Category B. Your code
|
|
189
|
+
corrections will change the preview output, so investigating Category B diffs first wastes
|
|
190
|
+
effort. Fix your own mistakes first, re-preview, then look at what remains.
|
|
191
|
+
|
|
192
|
+
**No `delete` or `replace` in the final preview.** If a delete or replace remains when
|
|
193
|
+
you're ready to create a PR, stop. A delete means `pulumi up` will destroy cloud
|
|
194
|
+
infrastructure. A replace means it will destroy and recreate. These are never acceptable
|
|
195
|
+
as "remaining diffs" - they must be resolved (via code fix, alias, or documented manual
|
|
196
|
+
steps) before proceeding.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Hard Rules
|
|
201
|
+
|
|
202
|
+
### Required CLI flags
|
|
203
|
+
|
|
204
|
+
Use these flags when running preview. A preview without them can show false diffs
|
|
205
|
+
(phantom tag removals, region additions) that aren't real. Don't interpret a preview
|
|
206
|
+
that was run without them.
|
|
207
|
+
|
|
208
|
+
```shell
|
|
209
|
+
pulumi preview --refresh --run-program
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
- `--refresh` refreshes actual cloud state before diffing.
|
|
213
|
+
- `--run-program` runs the Pulumi program during refresh.
|
|
214
|
+
|
|
215
|
+
### Don't chase deprecations
|
|
216
|
+
|
|
217
|
+
If something is deprecated but still works, leave it alone. Migrating to the replacement
|
|
218
|
+
introduces risk for no benefit. A deprecation warning is acceptable - a diff is not.
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
// BAD: migrating deprecated-but-working properties introduces risk
|
|
222
|
+
new aws.s3.Bucket('bucket');
|
|
223
|
+
new aws.s3.BucketLogging('bucketLogging', {...}); // unnecessary migration
|
|
224
|
+
|
|
225
|
+
// GOOD: fix only the actual error, leave working code alone
|
|
226
|
+
new aws.s3.Bucket('bucket', {
|
|
227
|
+
logging: {...}, // "loggings" renamed to "logging" - real breaking change
|
|
228
|
+
website: {...}, // deprecated but works - don't touch
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Be minimally invasive
|
|
233
|
+
|
|
234
|
+
Every line changed could introduce a regression. Prefer the smallest change that works.
|
|
235
|
+
|
|
236
|
+
### Do not run pulumi up
|
|
237
|
+
|
|
238
|
+
Provider upgrades modify source code and need code review before deployment.
|
|
239
|
+
PR -> review -> merge -> deploy via CI/CD.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Getting Started
|
|
244
|
+
|
|
245
|
+
### 1. Get version information
|
|
246
|
+
|
|
247
|
+
Determine the target version from the user's request, the Pulumi Registry, package
|
|
248
|
+
manager metadata, or the repository's existing dependency constraints.
|
|
249
|
+
|
|
250
|
+
Default to the latest stable version if the user hasn't specified a target version.
|
|
251
|
+
If the user asks which stacks or projects are affected, use skill `package-usage` or
|
|
252
|
+
the best available package inventory tooling before making changes.
|
|
253
|
+
|
|
254
|
+
### 2. Update the dependency
|
|
255
|
+
|
|
256
|
+
- **TypeScript/JavaScript**: `npm install @pulumi/{provider}@^{version}` or `yarn add @pulumi/{provider}@^{version}`
|
|
257
|
+
- **Python**: Update `pyproject.toml` or `requirements.txt` with `pulumi_{provider}>={version}` (underscore, not hyphen), then install
|
|
258
|
+
- **Go**: `go get github.com/pulumi/pulumi-{provider}/sdk/v{major}@latest`, update all import paths (e.g., `v6` -> `v7`), run `go mod tidy`
|
|
259
|
+
- **.NET**: `dotnet add package Pulumi.{Provider} --version {version}`
|
|
260
|
+
- **Java**: Update `pom.xml` or `build.gradle` dependency version
|
|
261
|
+
- **YAML**: Update provider version in resource options or provider configuration. See https://www.pulumi.com/docs/iac/languages-sdks/yaml/yaml-language-reference/#providers-and-provider-versions for examples.
|
|
262
|
+
|
|
263
|
+
After installing, check the actual installed version from the lockfile (package-lock.json,
|
|
264
|
+
go.sum, etc.) - use these exact versions for schema-tools comparisons.
|
|
265
|
+
|
|
266
|
+
### 3. Run preview
|
|
267
|
+
|
|
268
|
+
Run `pulumi preview --refresh --run-program` immediately after updating the dependency.
|
|
269
|
+
Do not research breaking changes first - many upgrades just work, especially minor
|
|
270
|
+
versions.
|
|
271
|
+
|
|
272
|
+
If the preview is clean (only the provider version bump), create a PR.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Preview Progress
|
|
277
|
+
|
|
278
|
+
Preview can fail on the first error and hide others. Fixing one error often reveals new
|
|
279
|
+
errors. This is normal progress, not a sign that fixes are making things worse.
|
|
280
|
+
|
|
281
|
+
- **New or different errors** -> progress, continue
|
|
282
|
+
- **Error set shrank** -> progress, continue
|
|
283
|
+
- **Same error persists** -> your fix didn't work, try a different approach
|
|
284
|
+
- **No errors but diffs** -> run the diff checkpoint
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Upgrade Summary
|
|
289
|
+
|
|
290
|
+
Once the preview is clean (or as clean as possible), present the summary:
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
## Upgrade Summary: {provider} v{current} -> v{target}
|
|
294
|
+
|
|
295
|
+
### Code Changes
|
|
296
|
+
| File | Change | Why it preserves intent |
|
|
297
|
+
|------|--------|------------------------|
|
|
298
|
+
| package.json | Version bump | - |
|
|
299
|
+
| index.ts:15 | loggings -> logging | Property renamed, same underlying field |
|
|
300
|
+
|
|
301
|
+
### Preview Result
|
|
302
|
+
All resources show `same` except provider version bump.
|
|
303
|
+
{Or: N resources show diffs - see below}
|
|
304
|
+
|
|
305
|
+
### Remaining Diffs (if any)
|
|
306
|
+
| Resource | Operation | What happens on `pulumi up` | Risk | Source |
|
|
307
|
+
|----------|-----------|---------------------------|------|--------|
|
|
308
|
+
| aws:s3:Bucket (myBucket) | update (-tags) | No-op, state reconciles | None | AWS v7 guide section 3.2 |
|
|
309
|
+
|
|
310
|
+
Every remaining diff MUST cite an authoritative source (upgrade guide, provider docs,
|
|
311
|
+
upstream GitHub issue). "I believe this is expected" is not a source.
|
|
312
|
+
|
|
313
|
+
### Manual Steps Required (if any)
|
|
314
|
+
1. `pulumi state delete '<urn>'` - remove old type binding
|
|
315
|
+
2. `pulumi import <type> <name> <id>` - adopt under new type
|
|
316
|
+
3. `pulumi preview --refresh --run-program` - verify clean
|
|
317
|
+
|
|
318
|
+
### Deprecation Warnings (no action taken)
|
|
319
|
+
- List deprecated-but-working code left intentionally
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
If the preview is clean (or all remaining diffs are documented no-ops with cited sources),
|
|
323
|
+
create a pull request. If unresolved diffs remain, present the summary as an exception
|
|
324
|
+
report and ask the user how they'd like to proceed before creating a PR.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## References
|
|
329
|
+
|
|
330
|
+
- `references/diagnostic-toolbox.md` - upgrade guides, schema-tools (install, run,
|
|
331
|
+
interpret output), stack state inspection, SDK types, GitHub issues. Read when
|
|
332
|
+
investigating Category B diffs.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Diagnostic Toolbox
|
|
2
|
+
|
|
3
|
+
Use these tools to investigate diffs - especially Category B diffs (resources you didn't
|
|
4
|
+
change code for). Reach for whichever tool fits the situation.
|
|
5
|
+
|
|
6
|
+
For major version upgrades, check the upgrade guide early - even alongside the first
|
|
7
|
+
preview. Upgrade guides contain sequencing requirements and edge cases that no other
|
|
8
|
+
tool can surface.
|
|
9
|
+
|
|
10
|
+
## Upgrade Guide (Pulumi or Terraform)
|
|
11
|
+
|
|
12
|
+
The most valuable resource for major version bumps. Contains migration patterns,
|
|
13
|
+
sequencing requirements, and documents which diffs are known preview artifacts.
|
|
14
|
+
|
|
15
|
+
The upgrade guide is the ONLY authoritative source for classifying a diff as a "known
|
|
16
|
+
no-op" - a diff that shows in preview but resolves on `pulumi up` without affecting
|
|
17
|
+
real infrastructure.
|
|
18
|
+
|
|
19
|
+
**Pulumi upgrade guide:**
|
|
20
|
+
Search for `site:pulumi.com {provider} migration guide v{major}`.
|
|
21
|
+
|
|
22
|
+
**Terraform upgrade guide** (for Terraform-based providers):
|
|
23
|
+
Check `https://registry.terraform.io/providers/{org}/{tf-provider}/latest/docs/guides/version-{major}-upgrade`
|
|
24
|
+
or search for `site:registry.terraform.io {tf-provider} version {major} upgrade`.
|
|
25
|
+
|
|
26
|
+
**When to use:** For any major version upgrade. Check it early.
|
|
27
|
+
|
|
28
|
+
## schema-tools - structured diff between versions
|
|
29
|
+
|
|
30
|
+
A structured diff of every schema change between provider versions. For large providers,
|
|
31
|
+
the diff can contain thousands of changes - always cross-reference with the resource
|
|
32
|
+
types actually present in the stack.
|
|
33
|
+
|
|
34
|
+
**Install** (if not available):
|
|
35
|
+
|
|
36
|
+
This example is intentionally lightweight and may drift over time. If the pinned version
|
|
37
|
+
below is stale, use the latest available `schema-tools` release instead of treating the
|
|
38
|
+
example version as authoritative.
|
|
39
|
+
|
|
40
|
+
```shell
|
|
41
|
+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
42
|
+
ARCH=$(uname -m)
|
|
43
|
+
case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64|arm64) ARCH="arm64" ;; esac
|
|
44
|
+
VERSION="v0.7.0"
|
|
45
|
+
curl -fsSL "https://github.com/pulumi/schema-tools/releases/download/${VERSION}/schema-tools-${VERSION}-${OS}-${ARCH}.tar.gz" \
|
|
46
|
+
-o /tmp/schema-tools.tar.gz
|
|
47
|
+
tar -xzf /tmp/schema-tools.tar.gz -C /tmp/
|
|
48
|
+
chmod +x /tmp/schema-tools
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Run and save to a file:**
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
/tmp/schema-tools compare -p {provider} -o v{current_version} -n v{target_version} --json > /tmp/{provider}-schema-diff.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The `-o` and `-n` flags must be full version tags (e.g., `v6.0.0`, `v7.0.0`), not just
|
|
58
|
+
major numbers. Use the exact versions from the lockfile.
|
|
59
|
+
|
|
60
|
+
**Useful queries:**
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
# Summary of all breaking change categories
|
|
64
|
+
jq '.summary' /tmp/{provider}-schema-diff.json
|
|
65
|
+
|
|
66
|
+
# Changes for a specific resource
|
|
67
|
+
jq '.grouped.resources["aws:s3/bucket:Bucket"]' /tmp/{provider}-schema-diff.json
|
|
68
|
+
|
|
69
|
+
# All changes of a specific type
|
|
70
|
+
jq '[.changes[] | select(.kind == "missing-input")]' /tmp/{provider}-schema-diff.json
|
|
71
|
+
|
|
72
|
+
# All breaking changes matching a pattern
|
|
73
|
+
jq '[.changes[] | select(.token | test("apigateway"))]' /tmp/{provider}-schema-diff.json
|
|
74
|
+
|
|
75
|
+
# List all affected resource tokens
|
|
76
|
+
jq '[.changes[] | .token] | unique' /tmp/{provider}-schema-diff.json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Each change entry has `kind`, `token`, `severity`, and `message` fields. The change
|
|
80
|
+
kinds you'll encounter most often during upgrades:
|
|
81
|
+
|
|
82
|
+
- **missing-input** - a property was removed from inputs. Usually renamed or replaced by
|
|
83
|
+
a different property with a different shape. The schema diff says it's gone but doesn't
|
|
84
|
+
say what replaced it - check the upgrade guide or new schema for the replacement.
|
|
85
|
+
- **type-changed** - a property's type changed. The most common pattern is a MaxItemsOne
|
|
86
|
+
flip: a property is renamed AND changes between single object and array (or vice versa).
|
|
87
|
+
Example: `certificateAuthorities` (array) -> `certificateAuthority` (single object).
|
|
88
|
+
- **token-remapped** - a resource or function was renamed. If "deprecated," the old name
|
|
89
|
+
still works (don't chase it). If "remapped," the old name is gone - rename in code and
|
|
90
|
+
add an alias to preserve state: `aliases: [{ type: "old:token:Name" }]`.
|
|
91
|
+
|
|
92
|
+
**When to use:** When preview errors mention unknown properties, missing fields, type
|
|
93
|
+
mismatches, or unrecognized resource types. The schema diff tells you exactly what was
|
|
94
|
+
renamed, removed, or reshaped.
|
|
95
|
+
|
|
96
|
+
## Stack state inspection - scope changes to this stack
|
|
97
|
+
|
|
98
|
+
Inspect the stack's deployed resource types. Essential for large providers - filter the
|
|
99
|
+
schema diff to only resources that matter. Use whatever state inspection tooling is
|
|
100
|
+
available in the environment, such as `pulumi stack --show-urns`, `pulumi stack export`,
|
|
101
|
+
state files, or backend resource inventory APIs.
|
|
102
|
+
|
|
103
|
+
```shell
|
|
104
|
+
# Example: list resource types from a stack export
|
|
105
|
+
pulumi stack export > /tmp/stack.json
|
|
106
|
+
jq -r '.deployment.resources[].type' /tmp/stack.json | sort -u
|
|
107
|
+
|
|
108
|
+
# Then filter schema diff to only resource types in the stack
|
|
109
|
+
jq '[.changes[] | select(.token | test("ZoneSettingsOverride|PageRule|Record|Zone"))]' \
|
|
110
|
+
/tmp/{provider}-schema-diff.json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**When to use:** Always use alongside schema-tools.
|
|
114
|
+
|
|
115
|
+
## SDK type definitions - inspect the new API shape
|
|
116
|
+
|
|
117
|
+
For TypeScript and Python projects, the installed package's type definitions show the
|
|
118
|
+
exact new API - property names, types, required vs. optional.
|
|
119
|
+
|
|
120
|
+
**TypeScript:** read `node_modules/@pulumi/{provider}/*.d.ts` for the resource type
|
|
121
|
+
**Python:** read the installed package source
|
|
122
|
+
|
|
123
|
+
Faster than schema-tools for answering "what does this resource look like now?"
|
|
124
|
+
|
|
125
|
+
## GitHub issues
|
|
126
|
+
|
|
127
|
+
Search `pulumi/pulumi-{provider}` and `hashicorp/terraform-provider-{tf-name}` for
|
|
128
|
+
specific error messages or resource names.
|
|
129
|
+
|
|
130
|
+
**When to use:** When upgrade guides don't cover an edge case, or when you're seeing
|
|
131
|
+
unexpected behavior that might be a known bug.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Queries that should activate the provider-upgrade skill
|
|
2
|
+
queries:
|
|
3
|
+
# Explicit upgrade requests
|
|
4
|
+
- "Upgrade the pulumi-aws provider in my project to the latest version"
|
|
5
|
+
- "How do I upgrade from pulumi-aws v5 to v6?"
|
|
6
|
+
- "Bump the pulumi-azure-native provider to v3 in my TypeScript project"
|
|
7
|
+
- "Upgrade pulumi-kubernetes from v3 to v4 across my stacks"
|
|
8
|
+
- "Update my GCP provider to the latest version"
|
|
9
|
+
- "Upgrade the Pulumi Cloudflare provider in this repo"
|
|
10
|
+
- "Help me bump the Datadog provider without changing real infrastructure"
|
|
11
|
+
|
|
12
|
+
# Breaking changes / migration
|
|
13
|
+
- "What are the breaking changes when upgrading pulumi-aws from v5 to v6?"
|
|
14
|
+
- "Is there a migration guide for pulumi-azure-native v2 to v3?"
|
|
15
|
+
- "The aws provider upgrade broke my S3 bucket resource, how do I fix it?"
|
|
16
|
+
- "After upgrading pulumi-aws, my preview shows resource replacements I didn't expect"
|
|
17
|
+
- "How do I add an alias for a renamed resource after a provider major version bump?"
|
|
18
|
+
- "My provider upgrade preview shows a create for infrastructure that already exists"
|
|
19
|
+
- "How do I handle deletes after a Pulumi provider major version upgrade?"
|
|
20
|
+
|
|
21
|
+
# Dependency management
|
|
22
|
+
- "How do I update @pulumi/aws to a newer version in my npm project?"
|
|
23
|
+
- "Update the pulumi_aws dependency in my Python requirements.txt"
|
|
24
|
+
- "Run go get to upgrade the Pulumi AWS provider SDK to the latest major version"
|
|
25
|
+
|
|
26
|
+
# Workflow / process questions
|
|
27
|
+
- "Walk me through upgrading the kubernetes provider without breaking my production stack"
|
|
28
|
+
- "What's the safe process for upgrading a Pulumi provider in a team environment?"
|