Skip to content

Commit 086af94

Browse files
fix: support for 32-bit ASN (#52)
* Added support for 32-bit ASN The variable `customer_gateway_bgp_asn` now automatically sets `bgp_asn` or `bgp_asn_extended` whether the value cannot be represented as a 32-bit number * Applied terraform format * Updated versions.tf * Updated references according to AWS provider version * Updated references according to AWS provider version
1 parent b097579 commit 086af94

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ Available targets:
105105
| Name | Version |
106106
|------|---------|
107107
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
108-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
108+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53.0 |
109109

110110
## Providers
111111

112112
| Name | Version |
113113
|------|---------|
114-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.0 |
114+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53.0 |
115115

116116
## Modules
117117

docs/terraform.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
| Name | Version |
55
|------|---------|
66
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
7-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
7+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.53.0 |
88

99
## Providers
1010

1111
| Name | Version |
1212
|------|---------|
13-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.0 |
13+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.53.0 |
1414

1515
## Modules
1616

main.tf

+7-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ resource "aws_vpn_gateway" "default" {
2020

2121
# https://www.terraform.io/docs/providers/aws/r/customer_gateway.html
2222
resource "aws_customer_gateway" "default" {
23-
count = local.enabled && var.customer_gateway_ip_address != null ? 1 : 0
24-
device_name = module.this.id
25-
bgp_asn = var.customer_gateway_bgp_asn
26-
ip_address = var.customer_gateway_ip_address
27-
type = "ipsec.1"
28-
tags = module.this.tags
23+
count = local.enabled && var.customer_gateway_ip_address != null ? 1 : 0
24+
device_name = module.this.id
25+
bgp_asn = var.customer_gateway_bgp_asn <= 2147483647 ? var.customer_gateway_bgp_asn : null
26+
bgp_asn_extended = var.customer_gateway_bgp_asn > 2147483647 ? var.customer_gateway_bgp_asn : null
27+
ip_address = var.customer_gateway_ip_address
28+
type = "ipsec.1"
29+
tags = module.this.tags
2930

3031
lifecycle {
3132
create_before_destroy = true

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 2.0"
7+
version = ">= 5.53.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)