I’d recommend you have a look at Automation API, which I think will be a far more elegant solution than
exec.Command
to perform operations on Pulumi stacks.
Also, you’ll want to review the documentation around Pulumi projects and stacks, so that you understand how to manipulate them with Automation API. The docs have some great materials here; let me know if you need links and I’ll look them up (although they should be pretty easy to find).
If you have further specific questions, let me know. I’m happy to help if I’m able.
👍 1
m
magnificent-vase-49161
02/07/2024, 1:48 PM
Thank you @salmon-account-74572 I'll take a look
magnificent-vase-49161
02/07/2024, 8:13 PM
Problem solved, I had to share the Pulumi ctx between the resources, otherwise it ends up trying to recreate the stack with each new resource added
s
salmon-account-74572
02/07/2024, 8:16 PM
Gotcha---yep, that would definitely do it. Glad you found a solution!
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.