fix: [CI SKIP] Converting various files to the same basic format.

This commit is contained in:
James Wells 2021-06-03 16:15:26 -07:00
parent 8f8ac47155
commit 0cf7f36f17
Signed by: jwells
GPG key ID: 73196D10B8E65666
9 changed files with 129 additions and 132 deletions

View file

@ -1,38 +1,38 @@
# variable "vpc_id" {}
data "aws_vpc" "selected" {
id = var.vpc_id
id = var.vpc_id
}
variable "regional_cidr_blocks" {
description = "A simple map of subnets used by region"
type = map
default = {
"us-west-2a-private" = "10.172.64.0/23",
"us-west-2b-private" = "10.172.66.0/23",
"us-west-2a-public" = "10.172.68.0/26",
"us-west-2b-public" = "10.172.68.64/26",
"us-east-1a-private" = "10.172.0.0/23",
"us-east-1b-private" = "10.172.2.0/23",
"us-east-1a-public" = "10.172.4.0/26",
"us-east-1b-public" = "10.172.4.64/26"
}
description = "A simple map of subnets used by region"
type = map
default = {
"us-west-2a-private" = "10.172.64.0/23",
"us-west-2b-private" = "10.172.66.0/23",
"us-west-2a-public" = "10.172.68.0/26",
"us-west-2b-public" = "10.172.68.64/26",
"us-east-1a-private" = "10.172.0.0/23",
"us-east-1b-private" = "10.172.2.0/23",
"us-east-1a-public" = "10.172.4.0/26",
"us-east-1b-public" = "10.172.4.64/26"
}
}
resource "aws_subnet" "aza-private" {
depends_on = [data.aws_vpc.selected]
vpc_id = data.aws_vpc.id
availability_zone = format("%sa", var.region)
cidr_block = var.regional_cidr_blocks[
format("%sa-private", var.region)
]
tags = merge(
var.extra_tags,
{
Name = "aza-private"
tier = "private"
}
)
depends_on = [data.aws_vpc.selected]
vpc_id = data.aws_vpc.id
availability_zone = format("%sa", var.region)
cidr_block = var.regional_cidr_blocks[
format("%sa-private", var.region)
]
tags = merge(
var.extra_tags,
{
Name = "aza-private"
tier = "private"
}
)
}
# resource "aws_subnet" "aza-public" {

View file

@ -1,9 +1,9 @@
variable "extra_tags" {
description = "Tags required on all resources"
type = map
default = {
"org" = "dragonheim"
"service" = "gagent"
"maintained_by" = "jwells@dragonheim.net"
}
description = "Tags required on all resources"
type = map
default = {
"org" = "dragonheim"
"service" = "gagent"
"maintained_by" = "jwells@dragonheim.net"
}
}

View file

@ -2,22 +2,22 @@ variable "region" {}
variable "provider_alias" {}
variable "regional_vpc_cidr" {
description = "A simple map of VPC subnets used by region"
type = map
default = {
"us-west-2" = "10.172.64.0/19",
"us-east-1" = "10.172.0.0/19",
}
description = "A simple map of VPC subnets used by region"
type = map
default = {
"us-west-2" = "10.172.64.0/19",
"us-east-1" = "10.172.0.0/19",
}
}
resource "aws_vpc" "gagent" {
instance_tenancy = "default"
enable_dns_support = true
cidr_block = var.regional_vpc_cidr[var.region]
tags = merge(
var.extra_tags,
{
Name = "gagent"
}
)
instance_tenancy = "default"
enable_dns_support = true
cidr_block = var.regional_vpc_cidr[var.region]
tags = merge(
var.extra_tags,
{
Name = "gagent"
}
)
}