What is the best practice for organizing stacks fo...
# aws
r
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
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
That definitely helps, thanks Mike!
p 1
m
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
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.!