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

Update for terraform 0.12 #265

Closed
Show file tree
Hide file tree
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
17 changes: 9 additions & 8 deletions examples/complete-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "aws" {

data "aws_security_group" "default" {
name = "default"
vpc_id = "${module.vpc.vpc_id}"
vpc_id = module.vpc.vpc_id
}

module "vpc" {
Expand Down Expand Up @@ -45,37 +45,37 @@ module "vpc" {
# VPC endpoint for SSM
enable_ssm_endpoint = true
ssm_endpoint_private_dns_enabled = true
ssm_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"] # ssm_endpoint_subnet_ids = ["..."]
ssm_endpoint_security_group_ids = [data.aws_security_group.default.id] # ssm_endpoint_subnet_ids = ["..."]

# VPC endpoint for SSMMESSAGES
enable_ssmmessages_endpoint = true
ssmmessages_endpoint_private_dns_enabled = true
ssmmessages_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
ssmmessages_endpoint_security_group_ids = [data.aws_security_group.default.id]

# VPC Endpoint for EC2
enable_ec2_endpoint = true
ec2_endpoint_private_dns_enabled = true
ec2_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
ec2_endpoint_security_group_ids = [data.aws_security_group.default.id]

# VPC Endpoint for EC2MESSAGES
enable_ec2messages_endpoint = true
ec2messages_endpoint_private_dns_enabled = true
ec2messages_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
ec2messages_endpoint_security_group_ids = [data.aws_security_group.default.id]

# VPC Endpoint for ECR API
enable_ecr_api_endpoint = true
ecr_api_endpoint_private_dns_enabled = true
ecr_api_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
ecr_api_endpoint_security_group_ids = [data.aws_security_group.default.id]

# VPC Endpoint for ECR DKR
enable_ecr_dkr_endpoint = true
ecr_dkr_endpoint_private_dns_enabled = true
ecr_dkr_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
ecr_dkr_endpoint_security_group_ids = [data.aws_security_group.default.id]

# VPC endpoint for KMS
enable_kms_endpoint = true
kms_endpoint_private_dns_enabled = true
kms_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
kms_endpoint_security_group_ids = [data.aws_security_group.default.id]

# kms_endpoint_subnet_ids = ["..."]

Expand All @@ -85,3 +85,4 @@ module "vpc" {
Name = "complete"
}
}

23 changes: 11 additions & 12 deletions examples/complete-vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
# VPC
output "vpc_id" {
description = "The ID of the VPC"
value = "${module.vpc.vpc_id}"
value = module.vpc.vpc_id
}

# Subnets
output "private_subnets" {
description = "List of IDs of private subnets"
value = ["${module.vpc.private_subnets}"]
value = module.vpc.private_subnets
}

output "public_subnets" {
description = "List of IDs of public subnets"
value = ["${module.vpc.public_subnets}"]
value = module.vpc.public_subnets
}

output "database_subnets" {
description = "List of IDs of database subnets"
value = ["${module.vpc.database_subnets}"]
value = module.vpc.database_subnets
}

output "elasticache_subnets" {
description = "List of IDs of elasticache subnets"
value = ["${module.vpc.elasticache_subnets}"]
value = module.vpc.elasticache_subnets
}

output "redshift_subnets" {
description = "List of IDs of redshift subnets"
value = ["${module.vpc.redshift_subnets}"]
value = module.vpc.redshift_subnets
}

output "intra_subnets" {
description = "List of IDs of intra subnets"
value = ["${module.vpc.intra_subnets}"]
value = module.vpc.intra_subnets
}

# NAT gateways
output "nat_public_ips" {
description = "List of public Elastic IPs created for AWS NAT Gateway"
value = ["${module.vpc.nat_public_ips}"]
value = module.vpc.nat_public_ips
}

# VPC endpoints
output "vpc_endpoint_ssm_id" {
description = "The ID of VPC endpoint for SSM"
value = "${module.vpc.vpc_endpoint_ssm_id}"
value = module.vpc.vpc_endpoint_ssm_id
}

output "vpc_endpoint_ssm_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for SSM."
value = ["${module.vpc.vpc_endpoint_ssm_network_interface_ids}"]
value = module.vpc.vpc_endpoint_ssm_network_interface_ids
}

output "vpc_endpoint_ssm_dns_entry" {
description = "The DNS entries for the VPC Endpoint for SSM."
value = ["${module.vpc.vpc_endpoint_ssm_dns_entry}"]
value = module.vpc.vpc_endpoint_ssm_dns_entry
}

//
Expand All @@ -73,4 +73,3 @@ output "vpc_endpoint_ssm_dns_entry" {
// description = "The DNS entries for the VPC Endpoint for EC2."
// value = ["${module.vpc.vpc_endpoint_ec2_dns_entry}"]
//}

4 changes: 4 additions & 0 deletions examples/complete-vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
1 change: 1 addition & 0 deletions examples/issue-108-route-already-exists/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ module "vpc" {
enable_s3_endpoint = true
enable_dynamodb_endpoint = true
}

13 changes: 7 additions & 6 deletions examples/issue-108-route-already-exists/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# VPC
output "vpc_id" {
description = "The ID of the VPC"
value = "${module.vpc.vpc_id}"
value = module.vpc.vpc_id
}

# Subnets
output "private_subnets" {
description = "List of IDs of private subnets"
value = ["${module.vpc.private_subnets}"]
value = module.vpc.private_subnets
}

output "public_subnets" {
description = "List of IDs of public subnets"
value = ["${module.vpc.public_subnets}"]
value = module.vpc.public_subnets
}

output "database_subnets" {
description = "List of IDs of database subnets"
value = ["${module.vpc.database_subnets}"]
value = module.vpc.database_subnets
}

output "elasticache_subnets" {
description = "List of IDs of elasticache subnets"
value = ["${module.vpc.elasticache_subnets}"]
value = module.vpc.elasticache_subnets
}

# NAT gateways
output "nat_public_ips" {
description = "List of public Elastic IPs created for AWS NAT Gateway"
value = ["${module.vpc.nat_public_ips}"]
value = module.vpc.nat_public_ips
}

4 changes: 4 additions & 0 deletions examples/issue-108-route-already-exists/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
5 changes: 3 additions & 2 deletions examples/issue-224-vpcendpoint-apigw/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "aws" {

data "aws_security_group" "default" {
name = "default"
vpc_id = "${module.vpc.vpc_id}"
vpc_id = module.vpc.vpc_id
}

module "vpc" {
Expand All @@ -19,7 +19,7 @@ module "vpc" {

# VPC endpoint for API gateway
enable_apigw_endpoint = true
apigw_endpoint_security_group_ids = ["${data.aws_security_group.default.id}"]
apigw_endpoint_security_group_ids = [data.aws_security_group.default.id]
apigw_endpoint_private_dns_enabled = true

tags = {
Expand All @@ -28,3 +28,4 @@ module "vpc" {
Name = "test-224"
}
}

4 changes: 4 additions & 0 deletions examples/issue-224-vpcendpoint-apigw/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
1 change: 1 addition & 0 deletions examples/issue-44-asymmetric-private-subnets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ module "vpc" {
Name = "asymmetrical"
}
}

13 changes: 7 additions & 6 deletions examples/issue-44-asymmetric-private-subnets/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# VPC
output "vpc_id" {
description = "The ID of the VPC"
value = "${module.vpc.vpc_id}"
value = module.vpc.vpc_id
}

# Subnets
output "private_subnets" {
description = "List of IDs of private subnets"
value = ["${module.vpc.private_subnets}"]
value = module.vpc.private_subnets
}

output "public_subnets" {
description = "List of IDs of public subnets"
value = ["${module.vpc.public_subnets}"]
value = module.vpc.public_subnets
}

output "database_subnets" {
description = "List of IDs of database subnets"
value = ["${module.vpc.database_subnets}"]
value = module.vpc.database_subnets
}

output "elasticache_subnets" {
description = "List of IDs of elasticache subnets"
value = ["${module.vpc.elasticache_subnets}"]
value = module.vpc.elasticache_subnets
}

# NAT gateways
output "nat_public_ips" {
description = "List of public Elastic IPs created for AWS NAT Gateway"
value = ["${module.vpc.nat_public_ips}"]
value = module.vpc.nat_public_ips
}

4 changes: 4 additions & 0 deletions examples/issue-44-asymmetric-private-subnets/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
1 change: 1 addition & 0 deletions examples/issue-46-no-private-subnets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ module "vpc" {
Name = "no-private-subnets"
}
}

13 changes: 7 additions & 6 deletions examples/issue-46-no-private-subnets/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# VPC
output "vpc_id" {
description = "The ID of the VPC"
value = "${module.vpc.vpc_id}"
value = module.vpc.vpc_id
}

# Subnets
output "private_subnets" {
description = "List of IDs of private subnets"
value = ["${module.vpc.private_subnets}"]
value = module.vpc.private_subnets
}

output "public_subnets" {
description = "List of IDs of public subnets"
value = ["${module.vpc.public_subnets}"]
value = module.vpc.public_subnets
}

output "database_subnets" {
description = "List of IDs of database subnets"
value = ["${module.vpc.database_subnets}"]
value = module.vpc.database_subnets
}

output "elasticache_subnets" {
description = "List of IDs of elasticache subnets"
value = ["${module.vpc.elasticache_subnets}"]
value = module.vpc.elasticache_subnets
}

# NAT gateways
output "nat_public_ips" {
description = "List of public Elastic IPs created for AWS NAT Gateway"
value = ["${module.vpc.nat_public_ips}"]
value = module.vpc.nat_public_ips
}

4 changes: 4 additions & 0 deletions examples/issue-46-no-private-subnets/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
1 change: 1 addition & 0 deletions examples/manage-default-vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ module "vpc" {
default_vpc_name = "default"
default_vpc_enable_dns_hostnames = true
}

5 changes: 3 additions & 2 deletions examples/manage-default-vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Default VPC
output "default_vpc_id" {
description = "The ID of the Default VPC"
value = "${module.vpc.default_vpc_id}"
value = module.vpc.default_vpc_id
}

output "default_vpc_cidr_block" {
description = "The CIDR block of the VPC"
value = "${module.vpc.default_vpc_cidr_block}"
value = module.vpc.default_vpc_cidr_block
}

4 changes: 4 additions & 0 deletions examples/manage-default-vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

terraform {
required_version = ">= 0.12"
}
14 changes: 9 additions & 5 deletions examples/network-acls/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ module "vpc" {
elasticache_subnets = ["10.0.201.0/24", "10.0.202.0/24", "10.0.203.0/24"]

public_dedicated_network_acl = true
public_inbound_acl_rules = "${concat(local.network_acls["default_inbound"], local.network_acls["public_inbound"])}"
public_outbound_acl_rules = "${concat(local.network_acls["default_outbound"], local.network_acls["public_outbound"])}"
public_inbound_acl_rules = concat(
local.network_acls["default_inbound"],
local.network_acls["public_inbound"],
)
public_outbound_acl_rules = concat(
local.network_acls["default_outbound"],
local.network_acls["public_outbound"],
)

private_dedicated_network_acl = true

Expand Down Expand Up @@ -51,7 +57,6 @@ locals {
cidr_block = "0.0.0.0/0"
},
]

default_outbound = [
{
rule_number = 900
Expand All @@ -62,7 +67,6 @@ locals {
cidr_block = "0.0.0.0/0"
},
]

public_inbound = [
{
rule_number = 100
Expand Down Expand Up @@ -97,7 +101,6 @@ locals {
cidr_block = "0.0.0.0/0"
},
]

public_outbound = [
{
rule_number = 100
Expand Down Expand Up @@ -134,3 +137,4 @@ locals {
]
}
}

Loading