Fix DNS E2E test + add one to net-lb-app-int-cross-region (#1993)

* Fix DNS E2E test + add one to net-lb-app-int-cross-region

* Update README.md

* Fix inventory for tests

* Fix tests

* Fix number of resources

---------

Co-authored-by: Julio Castillo <jccb@google.com>
This commit is contained in:
Wiktor Niesiobędzki 2024-01-23 16:34:45 +01:00 committed by GitHub
parent 070584ae74
commit 277777d1c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 58 additions and 47 deletions

View File

@ -90,26 +90,16 @@ module "private-dns" {
}
"A geo2" = {
geo_routing = [
{ location = "europe-west1", health_checked_targets = [
{ location = var.region, health_checked_targets = [
{
load_balancer_type = "globalL7ilb",
ip_address = "10.10.2.3",
port = "80",
ip_protocol = "tcp",
load_balancer_type = "globalL7ilb"
ip_address = module.net-lb-app-int-cross-region.addresses[var.region]
port = "80"
ip_protocol = "tcp"
network_url = var.vpc.self_link
project = var.project_id
}
] },
{ location = "europe-west2", health_checked_targets = [
{
load_balancer_type = "globalL7ilb",
ip_address = "10.10.3.3",
port = "80",
ip_protocol = "tcp",
network_url = var.vpc.self_link
project = var.project_id
}
] },
] }
]
}
"A wrr" = {
@ -122,7 +112,7 @@ module "private-dns" {
}
}
}
# tftest modules=1 resources=5 inventory=routing-policies.yaml e2e
# tftest modules=4 resources=12 fixtures=fixtures/net-lb-app-int-cross-region.tf,fixtures/compute-mig.tf inventory=routing-policies.yaml e2e
```
### Reverse Lookup Zone
@ -184,4 +174,9 @@ module "public-dns" {
| [name](outputs.tf#L32) | The DNS zone name. | |
| [name_servers](outputs.tf#L37) | The DNS zone name servers. | |
| [zone](outputs.tf#L42) | DNS zone resource. | |
## Fixtures
- [compute-mig.tf](../../tests/fixtures/compute-mig.tf)
- [net-lb-app-int-cross-region.tf](../../tests/fixtures/net-lb-app-int-cross-region.tf)
<!-- END TFDOC -->

View File

@ -22,6 +22,7 @@ Due to the complexity of the underlying resources, changes to the configuration
- [Files](#files)
- [Variables](#variables)
- [Outputs](#outputs)
- [Fixtures](#fixtures)
<!-- END TOC -->
### Minimal Example
@ -36,21 +37,18 @@ module "ilb-l7" {
backend_service_configs = {
default = {
backends = [{
group = "projects/myprj/zones/europe-west1-a/instanceGroups/my-ig-ew1"
}, {
group = "projects/myprj/zones/europe-west2-a/instanceGroups/my-ig-ew4"
group = module.compute-mig.group_manager.instance_group
}]
}
}
vpc_config = {
network = var.vpc.self_link
subnetworks = {
europe-west1 = var.subnet1.self_link
europe-west4 = var.subnet2.self_link
(var.region) = var.subnet.self_link
}
}
}
# tftest modules=1 resources=6
# tftest modules=3 resources=7 fixtures=fixtures/compute-mig.tf e2e
```
An HTTPS ILB needs a few additional fields:
@ -774,4 +772,8 @@ module "ilb-l7" {
| [neg_ids](outputs.tf#L61) | Autogenerated network endpoint group ids. | |
| [psc_neg_ids](outputs.tf#L68) | Autogenerated PSC network endpoint group ids. | |
| [regional_neg_ids](outputs.tf#L75) | Autogenerated regional network endpoint group ids. | |
## Fixtures
- [compute-mig.tf](../../tests/fixtures/compute-mig.tf)
<!-- END TFDOC -->

View File

@ -0,0 +1,34 @@
# Copyright 2024 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.
# requires fixtures/fixtures/compute-mig.tf
module "net-lb-app-int-cross-region" {
source = "./fabric/modules/net-lb-app-int-cross-region"
name = "ilb-test"
project_id = var.project_id
backend_service_configs = {
default = {
backends = [{
group = module.compute-mig.group_manager.instance_group
}]
}
}
vpc_config = {
network = var.vpc.self_link
subnetworks = {
(var.region) = var.subnet.self_link
}
}
}

View File

@ -64,28 +64,8 @@ values:
routing_policy:
- enable_geo_fencing: null
geo:
- health_checked_targets:
- internal_load_balancers:
- ip_address: 10.10.2.3
ip_protocol: tcp
load_balancer_type: globalL7ilb
network_url: projects/xxx/global/networks/aaa
port: '80'
project: project-id
region: null
location: europe-west1
rrdatas: null
- health_checked_targets:
- internal_load_balancers:
- ip_address: 10.10.3.3
ip_protocol: tcp
load_balancer_type: globalL7ilb
network_url: projects/xxx/global/networks/aaa
port: '80'
project: project-id
region: null
location: europe-west2
rrdatas: null
- location: europe-west8
rrdatas: null
primary_backup: []
wrr: []
rrdatas: null
@ -128,5 +108,5 @@ values:
counts:
google_dns_managed_zone: 1
google_dns_record_set: 4
modules: 1
resources: 5
modules: 4
resources: 12