pulumi-local
pulumi-local copied to clipboard
Config merge
Motivation
Config merging and respecting the original stack config is not something currently well supported in pulumi-local. To solve this issue, reported on this issue too, we'll introduce 3 different config strategies:
- overwrite strategy (current, default): this config option simply updates/overwrites the current config with the necessary changes we have to apply for LocalStack
-
override (with dry-run): this config option temporarily creates a config file by merging the original stacks config with our recommended options and running pulumi commands with it. By setting dry-run,
pulumi-localcreates the config file then terminates without running the command. -
separation: copying the currently selected stack's config and creates a new separate stack (by default called localstack, however this is configurable with
DEFAULT_STACK_NAMEenv variable)
If any of the config files we'd like to create exists we'll prompt for user input.
Additional options and features
-
DRY_RUN: in cases when makes sense creates the config file but terminates after without modifying it, if it finds an already existing one it prompts the user. -
--non-interactive/NON_INTERACTIVE: the usage of the non-interactive flag is now allowed to suppress anypulumi-localprompts for user input. -
LOCAL_STACK_NAME: the name of the LocalStack stack/config file we create, depending on the strategy - deactivate
aws:accessKeyandaws:secretKeyoptions
Changes
- [x] add user prompt for existing stack configs
- [x] add logic for strategy selection
- [x] add merge strategy, by taking leverage of
--config-fileoption of pulumi - [x] add separate stack strategy by copying the currently selected stack's config and then change to it
- [x] deactivate AWS credentials in the config file
- [x] create tests for strategies