From f6b860134a65bef1f25737771a65d1473f3e5a23 Mon Sep 17 00:00:00 2001 From: Jason Hancock Date: Fri, 2 Mar 2018 15:08:58 -0800 Subject: [PATCH] fix region configs --- main.tf | 2 ++ modules/ecs/auto_scaling.tf | 2 +- modules/ecs/variables.tf | 3 +-- modules/services/auto_scaling.tf | 2 +- modules/services/variables.tf | 3 +-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index ff70bfe..bcbb4d7 100644 --- a/main.tf +++ b/main.tf @@ -5,6 +5,7 @@ provider "aws" { module "ecs" { source = "./modules/ecs" + region = "${var.region}" platform_instance_id = "${var.platform_instance_id}" subnet_id = "${var.ecs_subnet_id}" ami_id = "${lookup(var.ecs_amis, var.region)}" @@ -63,6 +64,7 @@ module "rds" { module "services" { source = "./modules/services" + region = "${var.region}" customer = "${var.customer}" platform_instance_id = "${var.platform_instance_id}" ecs_nat_ip = "${var.ecs_nat_ip}" diff --git a/modules/ecs/auto_scaling.tf b/modules/ecs/auto_scaling.tf index 8a896b4..533569e 100644 --- a/modules/ecs/auto_scaling.tf +++ b/modules/ecs/auto_scaling.tf @@ -59,7 +59,7 @@ data "template_file" "userdata" { vars { ecs_cluster = "${aws_ecs_cluster.ecs_cluster.name}" file_system_id = "${aws_efs_file_system.ecs_filesystem.id}" - region = "${data.aws_region.current.name}" + region = "${var.region}" } } diff --git a/modules/ecs/variables.tf b/modules/ecs/variables.tf index 5c0792b..a956a57 100644 --- a/modules/ecs/variables.tf +++ b/modules/ecs/variables.tf @@ -1,3 +1,4 @@ +variable "region" {} variable "platform_instance_id" {} variable "subnet_id" {} variable "instance_type" {} @@ -11,8 +12,6 @@ variable "ssh_cidr_blocks" { description = "Comma delimited list of cidr blocks to allow SSH access from." } -data "aws_region" "current" {} - data "aws_subnet" "ecs_subnet" { id = "${var.subnet_id}" } diff --git a/modules/services/auto_scaling.tf b/modules/services/auto_scaling.tf index 7ea49c1..06f82f0 100644 --- a/modules/services/auto_scaling.tf +++ b/modules/services/auto_scaling.tf @@ -118,7 +118,7 @@ data "template_file" "userdata" { gm_env = "${var.customer}-${var.platform_instance_id}" gm_usage_prefix = "${var.customer}-${var.platform_instance_id}" jwt_key = "${var.jwt_key}" - region = "${data.aws_region.current.name}" + region = "${var.region}" rollbar_token = "${var.rollbar_token}" services_log_group = "GrayMetaPlatform-${var.platform_instance_id}-Services" sqs_activity = "${var.sqs_activity}" diff --git a/modules/services/variables.tf b/modules/services/variables.tf index 22a325c..c493dc7 100644 --- a/modules/services/variables.tf +++ b/modules/services/variables.tf @@ -1,3 +1,4 @@ +variable "region" {} variable "customer" {} variable "platform_instance_id" {} variable "platform_access_cidrs" {} @@ -56,8 +57,6 @@ variable "ssh_cidr_blocks" { description = "Comma delimited list of cidr blocks to allow SSH access from." } -data "aws_region" "current" {} - data "aws_subnet" "subnet_1" { id = "${var.subnet_id_1}" }