| 1 | --- |
| 2 | title: plan |
| 3 | description: Preview what would change without applying anything. Equivalent to alchemy deploy --dry-run. |
| 4 | --- |
| 5 | |
| 6 | import Terminal from "../../../components/Terminal.astro"; |
| 7 | |
| 8 | ```sh |
| 9 | alchemy plan [options] |
| 10 | ``` |
| 11 | |
| 12 | `plan` previews what would change without applying anything — it is equivalent to `alchemy deploy --dry-run`. |
| 13 | |
| 14 | <Terminal content={`[u]Plan[/u]: [g]1 to create[/g], [y]1 to update[/y] |
| 15 | |
| 16 | [g]+[/g] [b]Queue[/b] [d](AWS.SQS.Queue)[/d] |
| 17 | [y]~[/y] [b]Worker[/b] [d](Cloudflare.Worker)[/d]`} /> |
| 18 | |
| 19 | The plan uses `+` for creates, `~` for updates, `-` for deletes, |
| 20 | and `•` for no-ops. No approval prompt is shown and no changes are |
| 21 | made. |
| 22 | |
| 23 | ## Detailed property changes |
| 24 | |
| 25 | Pass `--detailed` to show declared resource inputs as YAML: |
| 26 | |
| 27 | ```sh |
| 28 | alchemy plan --detailed |
| 29 | ``` |
| 30 | |
| 31 | <Terminal content={`[u]Plan[/u]: [g]1 to create[/g], [y]1 to update[/y] |
| 32 | |
| 33 | [g]+[/g] [b]EventsQueue[/b] |
| 34 | [s2][g]properties:[/g] |
| 35 | [s4]fifo: true |
| 36 | [s4]visibilityTimeout: 30 |
| 37 | |
| 38 | [y]~[/y] [b]OrderHandler[/b] |
| 39 | [s2][r]before:[/r] |
| 40 | [s4]memorySize: 512 |
| 41 | [s4]env: |
| 42 | [s6]MODE: development |
| 43 | [s2][g]after:[/g] |
| 44 | [s4]memorySize: 1024 |
| 45 | [s4]env: |
| 46 | [s6]MODE: production`} /> |
| 47 | |
| 48 | Creates show their desired properties. Updates and replacements show the |
| 49 | previously persisted declared properties followed by the desired properties; |
| 50 | this is a declaration diff, not a live-cloud drift read. Outputs appear as |
| 51 | `(known after apply)`, computed values as `(computed)`, and secrets remain |
| 52 | redacted. Deletes stay compact. |
| 53 | |
| 54 | ## Flags |
| 55 | |
| 56 | | Option | Description | |
| 57 | | ------------------- | ----------------------------------------------------------------- | |
| 58 | | `--config, -c <file>` | Stack file to plan (defaults to `alchemy.run.ts`) | |
| 59 | | `--stage <name>` | Stage to plan against (defaults to `$ALCHEMY_STAGE` or `live_$USER`) | |
| 60 | | `--profile <name>` | Auth profile to use (defaults to `$ALCHEMY_PROFILE` or `default`) | |
| 61 | | `--env-file <path>` | Load environment variables from a file | |
| 62 | | `--adopt` | Plan adoption of pre-existing cloud resources that conflict with this stack instead of failing (see [Adopting Resources](/cli/adopting-resources)) | |
| 63 | | `--detailed` | Show declared resource properties as YAML | |
| 64 | |
| 65 | ## Where next |
| 66 | |
| 67 | - [deploy](/cli/deploy) — apply the plan |
| 68 | - [destroy](/cli/destroy) — delete everything in a stack |
| 69 | - [Inspecting State](/cli/inspecting-state) — examine what the plan diffs against |