Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing error Blocks of type "tags" are not expected here. Did you mea… #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ resource "aws_vpc" "CIS_VPC" {
cidr_block = "${var.CIS_VPC_CIDR}"
enable_dns_support = true
enable_dns_hostnames = true
tags {
tags = {
Name = "${var.CIS_VPC_Name_Tag}"
}
}
Expand All @@ -239,7 +239,7 @@ resource "aws_subnet" "CIS_Public_Subnets" {
cidr_block = "${cidrsubnet(aws_vpc.CIS_VPC.cidr_block, 8, var.Network_Resource_Count + count.index)}"
availability_zone = "${data.aws_availability_zones.Available_AZ.names[count.index]}"
map_public_ip_on_launch = true
tags {
tags = {
Name = "${var.CIS_VPC_Name_Tag}-PUB-Subnet-${element(data.aws_availability_zones.Available_AZ.names, count.index)}"
}
}
Expand All @@ -248,14 +248,14 @@ resource "aws_subnet" "CIS_Private_Subnets" {
vpc_id = "${aws_vpc.CIS_VPC.id}"
cidr_block = "${cidrsubnet(aws_vpc.CIS_VPC.cidr_block, 8, count.index)}"
availability_zone = "${data.aws_availability_zones.Available_AZ.names[count.index]}"
tags {
tags = {
Name = "${var.CIS_VPC_Name_Tag}-PRIV-Subnet-${element(data.aws_availability_zones.Available_AZ.names, count.index)}"
}
}
# attach IGW
resource "aws_internet_gateway" "CIS_IGW" {
vpc_id = "${aws_vpc.CIS_VPC.id}"
tags {
tags = {
Name = "${var.CIS_VPC_Name_Tag}-IGW"
}
}
Expand All @@ -267,23 +267,23 @@ resource "aws_route_table" "CIS_Public_RTB" {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.CIS_IGW.id}"
}
tags {
tags = {
Name = "PUB-RTB-${element(aws_subnet.CIS_Public_Subnets.*.id, count.index)}"
}
}
resource "aws_eip" "NATGW_Elastic_IPs" {
count = "${var.Network_Resource_Count}"
vpc = true
depends_on = ["aws_internet_gateway.CIS_IGW"]
tags {
tags = {
Name = "NAT-Gateway-EIP-${element(aws_subnet.CIS_Public_Subnets.*.id, count.index)}"
}
}
resource "aws_nat_gateway" "CIS_NAT_Gateway" {
count = "${var.Network_Resource_Count}"
subnet_id = "${element(aws_subnet.CIS_Public_Subnets.*.id, count.index)}"
allocation_id = "${element(aws_eip.NATGW_Elastic_IPs.*.id, count.index)}"
tags {
tags = {
Name = "NAT-Gateway-${element(aws_subnet.CIS_Public_Subnets.*.id, count.index)}"
}
}
Expand All @@ -294,7 +294,7 @@ resource "aws_route_table" "CIS_Private_RTB" {
cidr_block = "0.0.0.0/0"
nat_gateway_id = "${element(aws_nat_gateway.CIS_NAT_Gateway.*.id, count.index)}"
}
tags {
tags = {
Name = "PRIV-RTB-${element(aws_subnet.CIS_Private_Subnets.*.id, count.index)}"
}
}
Expand Down Expand Up @@ -362,7 +362,7 @@ EOF
# remove rules from default SG
resource "aws_default_security_group" "Default_Security_Group" {
vpc_id = "${aws_vpc.CIS_VPC.id}"
tags {
tags = {
Name = "DEFAULT_DO_NOT_USE"
}
}
Expand All @@ -388,7 +388,7 @@ resource "aws_security_group" "CIS_Linux_SG" {
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags {
tags = {
Name = "${var.CIS_VPC_Name_Tag}-Linux-SG"
}
}