Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc928af

Browse files
author
Achille Roussel
committed
give up on too much complexity, add better documentation
1 parent 743a74a commit bc928af

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

defaults/main.tf

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@ variable "cidr" {
2222
description = "The CIDR block to provision for the VPC"
2323
}
2424

25-
variable "default_availability_zones" {
26-
description = "A mapping of the default availability zones for each AWS region"
27-
28-
default = {
29-
us-east-1 = "us-east-1a,us-east-1b,us-east-1c,us-east-1e"
30-
us-west-1 = "us-west-1a,us-west-1b"
31-
us-west-2 = "us-west-2a,us-west-2b,us-west-2c"
32-
eu-west-1 = "eu-west-1a,eu-west-1b,eu-west-1c"
33-
eu-central-1 = "eu-central-1a,eu-central-1b"
34-
ap-southeast-1 = "ap-southeast-1a,ap-southeast-1b"
35-
ap-southeast-2 = "ap-southeast-2a,ap-southeast-2b,ap-southeast-2c"
36-
ap-northeast-1 = "ap-northeast-1a,ap-northeast-1c"
37-
ap-northeast-2 = "ap-northeast-2a,ap-northeast-2c"
38-
sa-east-1 = "sa-east-1a,sa-east-1b,sa-east-1c"
39-
}
40-
}
41-
4225
variable "default_ecs_ami" {
4326
default = {
4427
us-east-1 = "ami-5f3ff932"
@@ -72,10 +55,6 @@ variable "default_log_account_ids" {
7255
}
7356
}
7457

75-
output "availability_zones" {
76-
value = "${lookup(var.default_availability_zones, var.region)}"
77-
}
78-
7958
output "domain_name_servers" {
8059
value = "${cidrhost(var.cidr, 2)}"
8160
}

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ variable "domain_name_servers" {
3636
}
3737

3838
variable "region" {
39-
description = "the AWS region"
39+
description = "the AWS region in which resources are created, you must set the availability_zones variable as well if you define this value to something other than the default"
4040
default = "us-west-2"
4141
}
4242

@@ -57,7 +57,7 @@ variable "external_subnets" {
5757

5858
variable "availability_zones" {
5959
description = "a comma-separated list of availability zones, defaults to all AZ of the region, if set to something other than the defaults, both internal_subnets and external_subnets have to be defined as well"
60-
default = ""
60+
default = "us-west-2a,us-west-2b,us-west-2c"
6161
}
6262

6363
variable "ecs_instance_type" {
@@ -126,7 +126,7 @@ module "vpc" {
126126
cidr = "${var.cidr}"
127127
internal_subnets = "${var.internal_subnets}"
128128
external_subnets = "${var.external_subnets}"
129-
availability_zones = "${coalesce(var.availability_zones, module.defaults.availability_zones)}"
129+
availability_zones = "${var.availability_zones}"
130130
environment = "${var.environment}"
131131
}
132132

0 commit comments

Comments
 (0)