https://pulumi.com logo
Title
t

tall-scientist-89115

04/30/2021, 7:40 PM
Hey I'm diving into the database migration example to try to do something very similar for each way I want to seed a new database. I'm looking for best practices on shared configuration since this seeded database will share 100% of its configuration (cluster name, database name) with the feature app layer it's being created for. Is there a way to reference external stack outputs inside an automation inline program? My naive attempt at call
new pulumi.Config()
yielded:
throw new Error("Program run without the Pulumi engine available; re-run using the `pulumi` CLI");`
r

red-match-15116

04/30/2021, 7:46 PM
You could create a ConfigMap on the top level and pass it to setAllConfig for each stack.
👍 1
Is there a way to reference external stack outputs inside an automation inline program?
Can you say more about this part specifically? There is a separate stack that has these outputs?
You can get a stack’s outputs with stack.outputs() which might be helpful
t

tall-scientist-89115

04/30/2021, 7:56 PM
My cluster-configuration stack sets up the cluster. I'd like to use that cluster to spin up a rails app in a job to do migrations/(seed or load a sanitized copy of some real data). Ideally I could just pass the parent stacks as process args to the automation api script to initialize/destroy the database at the appropriate start and end caps for a particular feature life cycle.
r

red-match-15116

04/30/2021, 7:57 PM
The multi_stack_orchestration example is only in Go but it applies to this use case. If you’re willing to read through some Go code, the concept is applicable: https://github.com/pulumi/automation-api-examples/blob/main/go/multi_stack_orchestration/main.go
t

tall-scientist-89115

04/30/2021, 7:58 PM
Totally, thank you