give everything a name.

This commit is contained in:
Joe Tretter
2022-09-30 15:59:36 -05:00
parent 9b25fa2eda
commit 3d00a07e41
4 changed files with 23 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
resource "aws_internet_gateway" "test-env-gw" { resource "aws_internet_gateway" "test-env-gw" {
tags = {
"Name" = "tf-gateway-test-env"
}
vpc_id = "${aws_vpc.test-env.id}" vpc_id = "${aws_vpc.test-env.id}"
} }

View File

@@ -1,10 +1,18 @@
resource "aws_vpc" "test-env" { resource "aws_vpc" "test-env" {
tags = {
"Name" = "tf-vpc-test-env"
}
cidr_block = "10.0.0.0/16" cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true enable_dns_hostnames = true
enable_dns_support = true enable_dns_support = true
} }
resource "aws_eip" "ip-test-env" { resource "aws_eip" "ip-test-env" {
tags = {
"Name" = "tf-EIP-IP-test-env"
}
instance = "${aws_instance.app_server.id}" instance = "${aws_instance.app_server.id}"
vpc = true vpc = true
} }

View File

@@ -1,5 +1,8 @@
resource "aws_security_group" "ingress-all-test" { resource "aws_security_group" "ingress-all-test" {
name = "allow-all-sg" name = "allow-all-sg"
tags = {
"Name" = "tf-allow-all-sg"
}
vpc_id = "${aws_vpc.test-env.id}" vpc_id = "${aws_vpc.test-env.id}"
ingress { ingress {
cidr_blocks = [ cidr_blocks = [

View File

@@ -1,10 +1,18 @@
resource "aws_subnet" "subnet-uno" { resource "aws_subnet" "subnet-uno" {
tags = {
"Name" = "tf-subnet-uno"
}
cidr_block = "${cidrsubnet(aws_vpc.test-env.cidr_block, 3, 1)}" cidr_block = "${cidrsubnet(aws_vpc.test-env.cidr_block, 3, 1)}"
vpc_id = "${aws_vpc.test-env.id}" vpc_id = "${aws_vpc.test-env.id}"
availability_zone = "us-west-2a" availability_zone = "us-west-2a"
} }
resource "aws_route_table" "route-table-test-env" { resource "aws_route_table" "route-table-test-env" {
tags = {
"Name" = "tf-route-table-test-env"
}
vpc_id = "${aws_vpc.test-env.id}" vpc_id = "${aws_vpc.test-env.id}"
route { route {
cidr_block = "0.0.0.0/0" cidr_block = "0.0.0.0/0"