pulumi/pkg/backend/httpstate
Pat Gavlin d1ff268b10 [esc] Add commands for managing stack environments
These changes add three commands for managing a stack's environments:

- `pulumi config env init`, which creates a new environment for a stack
  based on its configuration values
- `pulumi config env add`, which adds environments to a stack's import
  list
- `pulumi config env rm`, which removes an environment from a stack's
  import list

As implied by their paths, these commands hang off of a new sub-command
of `pulumi config`, `pulumi config env`.

From the usage:

* `pulumi config env init`

Creates an environment for a specific stack based on the stack's
configuration values, then replaces the stack's configuration values with
a reference to that environment. The environment will be created in the
same organization as the stack.

* `pulumi config env add`

Adds environments to the end of a stack's import list. Imported
environments are merged in order per the ESC merge rules. The list of
stacks behaves as if it were the import list in an anonymous environment.

* `pulumi config env rm`

Removes an environment from a stack's import list.

Each of these commands previews the new stack environment and shows the
environment definition. These commands print a warning if the stack's
environment does not define any of the `environmentVariables`, `files`,
or `pulumiConfig` properties.

These changes also add an `ENVIRONMENT` block to the output of `pulumi
config` for stacks that reference environments. This block shows the
definition of the stack's environment. In order to improve the
appearence of these tables, these changes also add a helper function
that colorizes the header row.

Finally, these changes add a warning on `pulumi env add`, `pulumi env
rm`, and `pulumi up/refresh/etc.` for stacks that reference environments
that do define any of `environmentVariables`, `files`, or
`pulumiConfig`, and add a tag to update metadata that includes the
environments associated with an update.
2023-11-13 16:38:31 -08:00
..
client [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
testdata [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
backend.go [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
backend_test.go `pulumi new -s 'org/project/stack'` checks the proper organization for project existence rather than backend.currentUser()'s org. 2023-07-03 09:28:52 -07:00
console.go Add support for a PULUMI_CONSOLE_DOMAIN env var (#4410) 2020-04-17 11:50:00 -07:00
console_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diffs.go [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
diffs_post_1.20.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
diffs_pre_1.20.go [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
environments.go [esc] Add commands for managing stack environments 2023-11-13 16:38:31 -08:00
policypack.go Policy remediations feature (#14080) 2023-10-09 18:31:17 +00:00
snapshot.go Move SecretsManager from SnapshotPersister to SnapshotManager (#13976) 2023-09-19 18:31:56 +00:00
snapshot_test.go Cleanup result.Result in pkg/engine (#14136) 2023-10-11 14:44:09 +00:00
stack.go Add token info to whoami (#13206) 2023-09-23 12:46:11 +00:00
state.go [cli] Add an "open in browser" keybinding 2023-03-09 15:52:13 -08:00
token_source.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
token_source_test.go Use context.Background in tests (#14029) 2023-09-25 12:25:26 +00:00