Commit 9bc48445 authored by brian cenker's avatar brian cenker Committed by Anton Babenko

#22 add vpn gateway feature (#24)

parent 1cdd0002
......@@ -11,6 +11,7 @@ These types of resources are supported:
* [Route table](https://www.terraform.io/docs/providers/aws/r/route_table.html)
* [Internet Gateway](https://www.terraform.io/docs/providers/aws/r/internet_gateway.html)
* [NAT Gateway](https://www.terraform.io/docs/providers/aws/r/nat_gateway.html)
* [VPN Gateway](https://www.terraform.io/docs/providers/aws/r/vpn_gateway.html)
* [VPC Endpoint](https://www.terraform.io/docs/providers/aws/r/vpc_endpoint.html) (S3 and DynamoDB)
* [RDS DB Subnet Group](https://www.terraform.io/docs/providers/aws/r/db_subnet_group.html)
* [ElastiCache Subnet Group](https://www.terraform.io/docs/providers/aws/r/elasticache_subnet_group.html)
......@@ -30,6 +31,7 @@ module "vpc" {
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
enable_nat_gateway = true
enable_vpn_gateway = true
tags = {
Terraform = "true"
......
......@@ -14,6 +14,7 @@ module "vpc" {
create_database_subnet_group = false
enable_nat_gateway = true
enable_vpn_gateway = true
enable_s3_endpoint = true
enable_dynamodb_endpoint = true
......
......@@ -242,3 +242,14 @@ resource "aws_route_table_association" "public" {
subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
route_table_id = "${aws_route_table.public.id}"
}
##############
# VPN Gateway
##############
resource "aws_vpn_gateway" "this" {
count = "${var.enable_vpn_gateway ? 1 : 0}"
vpc_id = "${aws_vpc.this.id}"
tags = "${merge(var.tags, map("Name", format("%s", var.name)))}"
}
......@@ -112,3 +112,9 @@ output "vpc_endpoint_dynamodb_id" {
description = "The ID of VPC endpoint for DynamoDB"
value = "${aws_vpc_endpoint.dynamodb.id}"
}
# VPN Gateway
output "vgw_id" {
description = "The ID of the VPN Gateway"
value = "${aws_vpn_gateway.this.id}"
}
......@@ -80,6 +80,11 @@ variable "map_public_ip_on_launch" {
default = true
}
variable "enable_vpn_gateway" {
description = "Should be true if you want to create a new VPN Gateway resource and attach it to the VPC"
default = false
}
variable "private_propagating_vgws" {
description = "A list of VGWs the private route table should propagate"
default = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment