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

Add support for specifying AZ in VPN Gateway #401

Merged
merged 4 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.26.0
rev: v1.27.0
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
| transferserver\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for Transfer Server endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | `list(string)` | `[]` | no |
| vpc\_endpoint\_tags | Additional tags for the VPC Endpoints | `map(string)` | `{}` | no |
| vpc\_tags | Additional tags for the VPC | `map(string)` | `{}` | no |
| vpn\_gateway\_az | The Availability Zone for the VPN Gateway | `string` | `""` | no |
| vpn\_gateway\_id | ID of VPN Gateway to attach to the VPC | `string` | `""` | no |
| vpn\_gateway\_tags | Additional tags for the VPN gateway | `map(string)` | `{}` | no |

Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,9 @@ resource "aws_customer_gateway" "this" {
resource "aws_vpn_gateway" "this" {
count = var.create_vpc && var.enable_vpn_gateway ? 1 : 0

vpc_id = local.vpc_id
amazon_side_asn = var.amazon_side_asn
vpc_id = local.vpc_id
amazon_side_asn = var.amazon_side_asn
availability_zone = length(var.vpn_gateway_az) != 0 ? var.vpn_gateway_az : null
DrFaust92 marked this conversation as resolved.
Show resolved Hide resolved

tags = merge(
{
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,11 @@ variable "amazon_side_asn" {
default = "64512"
}

variable "vpn_gateway_az" {
description = "The Availability Zone for the VPN Gateway"
default = ""
DrFaust92 marked this conversation as resolved.
Show resolved Hide resolved
}

variable "propagate_private_route_tables_vgw" {
description = "Should be true if you want route table propagation"
type = bool
Expand Down