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

Do not set default ASN number #1633

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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