https://pulumi.com logo
Title
r

ripe-shampoo-80285

08/30/2021, 11:58 PM
What is the best practice for organizing stacks for multiple regions? Some resources are region specific, some are region agnostic. What is the best practice to organize code in such cases? Any advices will be appreciated.
s

steep-toddler-94095

08/31/2021, 12:09 AM
the answer to this will involve the details of your specific situation. it's hard to give a good answer without knowing those. as a general pattern though, group highly-related resources in the same stack. For example, if you might have a stack that contains an ingress controller and a route53 record to the ingress controller's external loadbalancer. it doesn't matter that route53 is region-agnostic. another example is if you have a single application that is distributed over multiple regions, put all those resources in the same stack. you can control the region for each resource by supplying it in the provider parameters. another one is if you have a "dev" environment and a "prod" environment, those should ideally be two separate stacks pointing to the same code, just with different parameters. It doesn't matter whether these environments are in the same region or not. does this help?
r

ripe-shampoo-80285

08/31/2021, 1:27 AM
That definitely helps, thanks Mike!
😛: 1
m

millions-furniture-75402

08/31/2021, 1:04 PM
In our case for AWS deployments, we have
<org>/<project>/<stack>.<region>
and in the few cases where one region needs something that another does not, we'll use a conditional in the plan.
r

ripe-shampoo-80285

09/02/2021, 3:44 PM
That sounds like a good practice, That way, we can rollout one region at a time to minimize the risk of global impact if something went wrong. Thanks, @millions-furniture-75402.!