https://pulumi.com logo
#automation-api
Title
# automation-api
h

handsome-state-59775

05/02/2021, 8:27 AM
I'm trying to create an CI/CD version of a currently CLI-driven Python program, but would like to retain CLI debuggability. 1. From the Go example for an inline/local hybrid, what is the Python equivalent of 
pulumi.Run()
 ? 2. Can I overlay configuration and secrets on top of a default stack's imported configuration? This would let me check in common secrets/config for a project, and have the CI/CD set env vars to provide optional overrides.
l

lemon-agent-27707

05/03/2021, 12:30 AM
1. Go does not support top level programs and all programs must execute inside
pulumi.Run()
this is not true for python. You should just be able to create a function that creates your resources and call that function from within both your automation api program and your CLI program 2. Not sure I fully understand. Would you mind providing a little more detail? With Automation API you can run any code you want as a part of the automation program. You can read config from a shared stack, set config/secrets on the current stack programmatically, and even do things like read values from AWS KMS or Azure Key Vault.
h

handsome-state-59775

05/03/2021, 6:49 AM
1. Got it, thanks! 2. Assuming this is the best way to go about this:
Copy code
base_stack = auto.select_stack(
        stack_name=base_stack_name,
        work_dir=str(work_dir),
)
base_config_all = base_stack.get_all_config()

new_config_all = ### MUTATE MAP
new_stack.set_all_config(new_config_all)
Do we have any high level functions for mutating ConfigMap/ConfigValue?
l

lemon-agent-27707

05/03/2021, 3:17 PM
Do we have any high level functions for mutating ConfigMap/ConfigValue?
no