Skip to content

Commit

Permalink
fix: ENI and ASG should use the same AZ
Browse files Browse the repository at this point in the history
  • Loading branch information
sugdyzhekov committed Jul 18, 2020
1 parent 6ad9c55 commit bad20ca
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ variable "instance_type" {
variable "private_subnet_cidrs" {
type = list(string)
}

data "aws_ami" "nat" {
most_recent = true
owners = ["amazon"]
Expand All @@ -22,11 +21,9 @@ data "aws_ami" "nat" {
values = ["amzn-ami-vpc-nat*"]
}
}

data "aws_subnet" "nat" {
id = local.public_subnet_ids[0]
}

data "aws_region" "current" {}

locals {
Expand All @@ -35,7 +32,7 @@ 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"
az = data.aws_subnet.nat.availability_zone
tags = merge({
Name = local.name
Module = "Nat Instance"
Expand Down

0 comments on commit bad20ca

Please sign in to comment.