4
0
Fork 0

added availibility zone

Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
Mark Bolwell 2022-08-05 12:23:32 +01:00
parent f863e97a92
commit d83ee52a98
No known key found for this signature in database
GPG key ID: F734FDFC154B83FB
3 changed files with 14 additions and 6 deletions

View file

@ -16,8 +16,9 @@ resource "aws_internet_gateway" "IGW" {
} }
resource "aws_subnet" "publicsubnets" { resource "aws_subnet" "publicsubnets" {
vpc_id = aws_vpc.Main.id vpc_id = aws_vpc.Main.id
cidr_block = var.public_subnets cidr_block = var.public_subnets
availability_zone = var.availability_zone
tags = { tags = {
Environment = "${var.environment}" Environment = "${var.environment}"
Name = "${var.namespace}-pubsub" Name = "${var.namespace}-pubsub"

View file

@ -1,5 +1,6 @@
// vars should be loaded by OSname.tfvars // vars should be loaded by OSname.tfvars
aws_region = "us-east-1" availability_zone = "us-east-1b"
ami_os = var.ami_os aws_region = "us-east-1"
ami_username = var.ami_username ami_os = var.ami_os
instance_tags = var.instance_tags ami_username = var.ami_username
instance_tags = var.instance_tags

View file

@ -6,6 +6,12 @@ variable "aws_region" {
type = string type = string
} }
variable "availability_zone" {
description = "List of availability zone in the region"
default = "us-east-1b"
type = string
}
variable "instance_type" { variable "instance_type" {
description = "EC2 Instance Type" description = "EC2 Instance Type"
default = "t3.micro" default = "t3.micro"