From 19c0b24c0ec992466aedc94a145c777d5acb975e Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Sun, 19 Aug 2018 17:47:34 +0200 Subject: [PATCH 1/2] Added amazon_side_asn to vpn_gateway --- README.md | 1 + main.tf | 3 ++- variables.tf | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44571477d..ad33c91ce 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ Terraform version 0.10.3 or newer is required for this module to work. | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| amazon_side_asn | The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN. | string | `` | no | | assign_generated_ipv6_cidr_block | Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block | string | `false` | no | | azs | A list of availability zones in the region | string | `` | no | | cidr | The CIDR block for the VPC. Default value is a valid CIDR, but not acceptable by AWS and should be overridden | string | `0.0.0.0/0` | no | diff --git a/main.tf b/main.tf index c1d3eaf75..64f53cfbb 100644 --- a/main.tf +++ b/main.tf @@ -421,7 +421,8 @@ resource "aws_route_table_association" "public" { resource "aws_vpn_gateway" "this" { count = "${var.create_vpc && var.enable_vpn_gateway ? 1 : 0}" - vpc_id = "${aws_vpc.this.id}" + vpc_id = "${aws_vpc.this.id}" + amazon_side_asn = "${var.amazon_side_asn}" tags = "${merge(map("Name", format("%s", var.name)), var.vpn_gateway_tags, var.tags)}" } diff --git a/variables.tf b/variables.tf index c5c753c9c..1480df5ec 100644 --- a/variables.tf +++ b/variables.tf @@ -143,6 +143,11 @@ variable "vpn_gateway_id" { default = "" } +variable "amazon_side_asn" { + description = "The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN." + default = "" # Error: module.vpc.aws_vpn_gateway.this: "amazon_side_asn" ("") must be a 64-bit integer +} + variable "propagate_private_route_tables_vgw" { description = "Should be true if you want route table propagation" default = false From bfa36d71bc5b4d55416847619bdb1cbbe3171a9f Mon Sep 17 00:00:00 2001 From: tbugfinder <15378237+tbugfinder@users.noreply.github.com> Date: Mon, 1 Oct 2018 21:06:58 +0200 Subject: [PATCH 2/2] change to Amazon default ASN (as per API) (#176) https://docs.aws.amazon.com/cli/latest/reference/ec2/create-vpn-gateway.html --- variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variables.tf b/variables.tf index 1480df5ec..027afe487 100644 --- a/variables.tf +++ b/variables.tf @@ -144,8 +144,8 @@ variable "vpn_gateway_id" { } variable "amazon_side_asn" { - description = "The Autonomous System Number (ASN) for the Amazon side of the gateway. If you don't specify an ASN, the virtual private gateway is created with the default ASN." - default = "" # Error: module.vpc.aws_vpn_gateway.this: "amazon_side_asn" ("") must be a 64-bit integer + description = "The Autonomous System Number (ASN) for the Amazon side of the gateway. By default the virtual private gateway is created with the current default Amazon ASN." + default = "64512" } variable "propagate_private_route_tables_vgw" {