Skip to content

Commit

Permalink
Do not set default ASN number (#1633)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaPrete authored Aug 28, 2023
1 parent 6459e7c commit 9d0fd74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions modules/net-cloudnat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ module "nat" {
# tftest modules=2 resources=5 inventory=rules.yaml
```
<!-- BEGIN TFDOC -->

## Variables

| name | description | type | required | default |
Expand All @@ -76,7 +75,7 @@ module "nat" {
| [config_source_subnets](variables.tf#L39) | Subnetwork configuration (ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS). | <code>string</code> | | <code>&#34;ALL_SUBNETWORKS_ALL_IP_RANGES&#34;</code> |
| [config_timeouts](variables.tf#L45) | Timeout configurations. | <code title="object&#40;&#123;&#10; icmp &#61; optional&#40;number, 30&#41;&#10; tcp_established &#61; optional&#40;number, 1200&#41;&#10; tcp_transitory &#61; optional&#40;number, 30&#41;&#10; udp &#61; optional&#40;number, 30&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [logging_filter](variables.tf#L57) | Enables logging if not null, value is one of 'ERRORS_ONLY', 'TRANSLATIONS_ONLY', 'ALL'. | <code>string</code> | | <code>null</code> |
| [router_asn](variables.tf#L78) | Router ASN used for auto-created router. | <code>number</code> | | <code>64514</code> |
| [router_asn](variables.tf#L78) | Router ASN used for auto-created router. | <code>number</code> | | <code>null</code> |
| [router_create](variables.tf#L84) | Create router. | <code>bool</code> | | <code>true</code> |
| [router_name](variables.tf#L90) | Router name, leave blank if router will be created to use auto generated name. | <code>string</code> | | <code>null</code> |
| [router_network](variables.tf#L96) | Name of the VPC used for auto-created router. | <code>string</code> | | <code>null</code> |
Expand All @@ -93,5 +92,4 @@ module "nat" {
| [region](outputs.tf#L32) | Cloud NAT region. | |
| [router](outputs.tf#L37) | Cloud NAT router resources (if auto created). | |
| [router_name](outputs.tf#L46) | Cloud NAT router name. | |

<!-- END TFDOC -->
8 changes: 6 additions & 2 deletions modules/net-cloudnat/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ resource "google_compute_router" "router" {
project = var.project_id
region = var.region
network = var.router_network
bgp {
asn = var.router_asn

dynamic "bgp" {
for_each = var.router_asn == null ? [] : [1]
content {
asn = var.router_asn
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/net-cloudnat/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ variable "region" {
variable "router_asn" {
description = "Router ASN used for auto-created router."
type = number
default = 64514
default = null
}

variable "router_create" {
Expand Down

0 comments on commit 9d0fd74

Please sign in to comment.