How do you go about having pieces that need to be created before others.
Specifically creating an ECR repository, have a GitHub action workflow push a first image that depends on the creation of the repository which can then be deployed in apprunner for example.
06/14/2023, 5:05 PM
There's an inherent dependency analysis that Pulumi does by default. The key to thinking about this is that your entire code will run before any resources are modified/created/destroyed. It's basically making a list of instructions to do on your resources. If you run a function that depends a previously configured resource, it knows to put that further down the list.
That said, if there's a very specific order you need things to run it, you can use the Depends On function: https://www.pulumi.com/docs/concepts/options/dependson/
This can override the automatic inference, which can cause problems, so use with care.
06/14/2023, 5:22 PM
I’ll have a look.
Thé Major issue I can think off the async nature of this.
Wait or pause so another process somewhere builds and pushes the image
Of course I could create the repository by hand, but that kind of defeats the purpose of using pulumi
So for example, I'm building a microstack in one subdirectory that will hold AWS account creation. Another microstack handles GitHub and uses the outputs from the first microstack to create a repository for that AWS account in GitHub.
This is where I'm at as I adopt Pulumi, so there could be some other elements I'm missing, but hopefully that speeds you up to where I'm at.
06/14/2023, 6:07 PM
That makes sense, I made a core project and another that depends on it but taking it further is worth looking.
Thanks for the feedback!