From 7178b979fd18aa3097d60c5197ba275a2e704ec5 Mon Sep 17 00:00:00 2001 From: Sergei Ugdyzhekov Date: Sat, 18 Jul 2020 21:22:14 +0200 Subject: [PATCH] fix: Don't hardcode region of ASG --- asg.tf | 2 +- variables.tf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/asg.tf b/asg.tf index c372ed7..06f396d 100644 --- a/asg.tf +++ b/asg.tf @@ -3,7 +3,7 @@ resource "aws_autoscaling_group" "nat_instance" { desired_capacity = 1 max_size = 1 min_size = 1 - availability_zones = ["eu-west-1b"] + availability_zones = [local.az] launch_template { id = aws_launch_template.nat_instance.id diff --git a/variables.tf b/variables.tf index 0f89745..b47b34c 100644 --- a/variables.tf +++ b/variables.tf @@ -31,4 +31,5 @@ locals { instance_type = var.instance_type public_subnet_ids = [var.public_subnet_id] private_subnet_cidrs = var.private_subnet_cidrs + az = "${data.aws_region.current.name}b" } \ No newline at end of file