Skip to content

Commit c63d2cb

Browse files
authored
fix: Remove the dependency of hard coded region and availability zones (#22)
1 parent 63eb988 commit c63d2cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/complete-ecs/main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
provider "aws" {
2-
region = "eu-west-1"
3-
}
4-
51
locals {
62
name = "complete-ecs"
73
environment = "dev"
@@ -10,6 +6,10 @@ locals {
106
ec2_resources_name = "${local.name}-${local.environment}"
117
}
128

9+
data "aws_availability_zones" "available" {
10+
state = "available"
11+
}
12+
1313
module "vpc" {
1414
source = "terraform-aws-modules/vpc/aws"
1515
version = "~> 2.0"
@@ -18,7 +18,7 @@ module "vpc" {
1818

1919
cidr = "10.1.0.0/16"
2020

21-
azs = ["eu-west-1a", "eu-west-1b"]
21+
azs = data.aws_availability_zones.available.names
2222
private_subnets = ["10.1.1.0/24", "10.1.2.0/24"]
2323
public_subnets = ["10.1.11.0/24", "10.1.12.0/24"]
2424

0 commit comments

Comments
 (0)