Skip to content

Commit

Permalink
Update readme and add module tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Prete committed Oct 21, 2023
1 parent b7813bf commit 088d01b
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 23 deletions.
121 changes: 98 additions & 23 deletions modules/net-lb-ext/README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions tests/modules/net_lb_ext/defaults.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project_id = "my-project"
region = "europe-west1"
name = "nlb-test"
backends = [{
group = "foo"
failover = false
}]
46 changes: 46 additions & 0 deletions tests/modules/net_lb_ext/defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

values:
google_compute_forwarding_rule.forwarding_rules[""]:
all_ports: true
ip_protocol: TCP
labels: null
load_balancing_scheme: EXTERNAL
name: nlb-test
project: my-project
region: europe-west1
google_compute_region_backend_service.default:
backend:
- balancing_mode: CONNECTION
capacity_scaler: null
description: Terraform managed.
failover: false
group: foo
max_connections: null
max_connections_per_endpoint: null
max_connections_per_instance: null
max_rate: null
max_rate_per_endpoint: null
max_rate_per_instance: null
max_utilization: null
load_balancing_scheme: EXTERNAL
name: nlb-test
project: my-project
protocol: UNSPECIFIED
region: europe-west1

counts:
google_compute_forwarding_rule: 1
google_compute_region_backend_service: 1
15 changes: 15 additions & 0 deletions tests/modules/net_lb_ext/dual-stack.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
project_id = "my-project"
region = "europe-west1"
name = "nlb-test"
backends = [{
group = "foo"
failover = false
}]
forwarding_rules_config = {
ipv4 = {
ip_version = "IPV4"
}
ipv6 = {
ip_version = "IPV6"
}
}
23 changes: 23 additions & 0 deletions tests/modules/net_lb_ext/dual-stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

values:
google_compute_forwarding_rule.forwarding_rules["ipv4"]:
ip_version: "IPV4"
google_compute_forwarding_rule.forwarding_rules["ipv6"]:
ip_version: "IPV6"

counts:
google_compute_forwarding_rule: 2
google_compute_region_backend_service: 1
13 changes: 13 additions & 0 deletions tests/modules/net_lb_ext/forwarding-rule.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project_id = "my-project"
region = "europe-west1"
name = "nlb-test"
backends = [{
group = "foo"
failover = false
}]
forwarding_rules_config = {
"port-80" = {
ports = [80]
}
}

23 changes: 23 additions & 0 deletions tests/modules/net_lb_ext/forwarding-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

values:
google_compute_forwarding_rule.forwarding_rules["port-80"]:
all_ports: null
ports:
- '80'

counts:
google_compute_forwarding_rule: 1
google_compute_region_backend_service: 1
20 changes: 20 additions & 0 deletions tests/modules/net_lb_ext/tftest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module: modules/net-lb-ext

tests:
defaults:
dual-stack:
forwarding-rule:

0 comments on commit 088d01b

Please sign in to comment.