I think in this scenario you would have 2 projects, one of which being the project that contains your temporary infrastructure. So you'd
pulumi up
the first project, do your external scripts / work,
pulumi up
the 2nd project, and then
pulumi destroy
the first.
You could do all that using the CLI I think, but you could also leverage Automation API to orchestrate
b
boundless-angle-56560
05/05/2021, 12:48 PM
yeah I could use some direct API (like boto3 in python) and do my stuff in some function that gets executed during pulumi processing but there I would need to reinvent lot of low level stuff that is sorted by pulumi resource libraries
boundless-angle-56560
05/05/2021, 12:49 PM
and spliting it to two project implies a manual step or slapping some glue layer on top and avoiding this is one reason why I use pulumi 🙂
b
bored-oyster-3147
05/05/2021, 12:51 PM
well the Automation API would alleviate that. Nothing manual about it, you could have a single console app that does all of those steps and is run all at once in your CI/CD.
b
boundless-angle-56560
05/05/2021, 2:20 PM
@bored-oyster-3147 thanks, will check the Automation API out 🙂
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.