Reputation: 21486
When I manually create an AWS ECS cluster in the UI, by default it shows the default VPC with the default subnets selected, one in each availability region, which I infer to be best practice.
I'm creating a new ECS Fargate deployment using CloudFormation, and I believe the best practice is to create a new VPC with its own subnets, similarly each in a different availability zone.
Rather than hard-coding them in CloudFormation, how can I enumerate the availability zones for the current region and create subnets for each of them?
I'm new to CloudFormation. I've seen that there is a built-in function to enumerate availability zones, so with some thought I'm sure I can figure this out on my own. And I'll be sure to add that as an answer here. But being what surely is a common use case, perhaps there is an existing best-practices template somewhere that already shows how to do that so I don't have to reinvent it. (I haven't been able to find it immediately by searching.)
Upvotes: 0
Views: 59