https://pulumi.com logo
Title
l

limited-river-80186

04/10/2023, 7:41 PM
Hey everyone, I might be thinking about this wrong but I am wondering the best way to go about getting our GCP Cloud SQL Connection Name after we deploy our infrastructure. Our Database migration script will run in Github Actions and it will need the Connection Name. Is there a way to grab it from Pulumi? Or should we just store it in the secrets manager?
l

little-cartoon-10569

04/10/2023, 8:18 PM
Storing it in a cloud vault is a viable option and makes it visible to tools and services that don't have access to the build or Pulumi CLI. But if your migration script is being called from somewhere with access to the Pulumi CLI, you can export the value from the Pulumi program, and call
pulumi stack output
to get those exported values
s

stocky-restaurant-98004

04/10/2023, 8:18 PM
export const connectionName = ...
is how you create a stack output.
pulumi stack output connectionName --secret
will get you the value from the command line (if it contains secrets). If it's a secret, storing in Secrets Manager is also a valid approach.
Usually it's a good sign when Paul and I agree. 😉
l

little-cartoon-10569

04/10/2023, 8:19 PM
Yep. Last time we didn't agree, there was a global financial crisis. That didn't go well.
s

stocky-restaurant-98004

04/10/2023, 8:19 PM
lol
I don't remember that per se, but I'll believe it. 😉
l

little-cartoon-10569

04/10/2023, 8:19 PM
😉
l

limited-river-80186

04/11/2023, 2:47 PM
Thanks @little-cartoon-10569 and @stocky-restaurant-98004! I will give it a try with using
pulumi stack output