Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ecs/atlantis] Update terraform-aws-dynamic-subnets version. Add the ability to choose NAT Gateways or NAT Instances #180

Merged
merged 2 commits into from
Jun 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions aws/ecs/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,47 @@ variable "availability_zones" {
description = "List of Availability Zones to provision all the resources in"
}

variable "nat_gateway_enabled" {
type = "string"
description = "Flag to enable/disable NAT Gateways to allow servers in the private subnets to access the Internet"
default = "true"
}

variable "nat_instance_enabled" {
type = "string"
description = "Flag to enable/disable NAT Instances to allow servers in the private subnets to access the Internet"
default = "false"
}

variable "nat_instance_type" {
type = "string"
description = "NAT Instance type"
default = "t3.micro"
}

locals {
name = "${var.region}"
}

module "vpc" {
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.3.4"
source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.4.1"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "${local.name}"
cidr_block = "172.16.0.0/16"
}

module "subnets" {
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.8.0"
availability_zones = "${var.availability_zones}"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "${local.name}"
region = "${var.region}"
vpc_id = "${module.vpc.vpc_id}"
igw_id = "${module.vpc.igw_id}"
cidr_block = "${module.vpc.vpc_cidr_block}"
nat_gateway_enabled = "true"
source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.9.0"
availability_zones = "${var.availability_zones}"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "${local.name}"
region = "${var.region}"
vpc_id = "${module.vpc.vpc_id}"
igw_id = "${module.vpc.igw_id}"
cidr_block = "${module.vpc.vpc_cidr_block}"
nat_gateway_enabled = "${var.nat_gateway_enabled}"
nat_instance_enabled = "${var.nat_instance_enabled}"
nat_instance_type = "${var.nat_instance_type}"
}