Skip to content

Commit de5fc66

Browse files
authored
Added amazon_side_asn to vpn_gateway (#159)
* Added amazon_side_asn to vpn_gateway * change to Amazon default ASN (as per API) (#176) https://docs.aws.amazon.com/cli/latest/reference/ec2/create-vpn-gateway.html
1 parent 68e84ef commit de5fc66

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Terraform version 0.10.3 or newer is required for this module to work.
167167

168168
| Name | Description | Type | Default | Required |
169169
|------|-------------|:----:|:-----:|:-----:|
170+
| 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 |
170171
| 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 |
171172
| azs | A list of availability zones in the region | string | `<list>` | no |
172173
| 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 |

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ resource "aws_route_table_association" "public" {
432432
resource "aws_vpn_gateway" "this" {
433433
count = "${var.create_vpc && var.enable_vpn_gateway ? 1 : 0}"
434434

435-
vpc_id = "${local.vpc_id}"
435+
vpc_id = "${local.vpc_id}"
436+
amazon_side_asn = "${var.amazon_side_asn}"
436437

437438
tags = "${merge(map("Name", format("%s", var.name)), var.tags, var.vpn_gateway_tags)}"
438439
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ variable "vpn_gateway_id" {
173173
default = ""
174174
}
175175

176+
variable "amazon_side_asn" {
177+
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."
178+
default = "64512"
179+
}
180+
176181
variable "propagate_private_route_tables_vgw" {
177182
description = "Should be true if you want route table propagation"
178183
default = false

0 commit comments

Comments
 (0)