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

Use zones b and c for MIG fixture #1961

Merged
merged 1 commit into from
Jan 5, 2024
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
68 changes: 34 additions & 34 deletions modules/net-lb-app-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [
{ backend = module.compute-mig-a.group.id },
{ backend = module.compute-mig-b.group.id },
{ backend = module.compute-mig-c.group.id },
]
}
}
}
# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-ab.tf inventory=minimal-http.yaml e2e
# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf inventory=minimal-http.yaml e2e
```

### Minimal HTTPS examples
Expand All @@ -69,8 +69,8 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [
{ backend = module.compute-mig-a.group.id },
{ backend = module.compute-mig-b.group.id },
{ backend = module.compute-mig-c.group.id },
]
protocol = "HTTP"
}
Expand All @@ -84,7 +84,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-ab.tf inventory=http-backends.yaml e2e
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=http-backends.yaml e2e
```

#### HTTPS backends
Expand All @@ -99,8 +99,8 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [
{ backend = module.compute-mig-a.group.id },
{ backend = module.compute-mig-b.group.id },
{ backend = module.compute-mig-c.group.id },
]
protocol = "HTTPS"
}
Expand All @@ -121,7 +121,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-ab.tf inventory=https-backends.yaml e2e
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=https-backends.yaml e2e
```

#### HTTP to HTTPS redirect
Expand Down Expand Up @@ -180,7 +180,7 @@ module "glb-test-0" {
}
}

# tftest modules=5 resources=14 fixtures=fixtures/compute-mig-ab.tf inventory=http-https-redirect.yaml e2e
# tftest modules=5 resources=14 fixtures=fixtures/compute-mig-bc.tf inventory=http-https-redirect.yaml e2e
```

### Classic vs Non-classic
Expand All @@ -196,13 +196,13 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [
{ backend = module.compute-mig-a.group.id },
{ backend = module.compute-mig-b.group.id },
{ backend = module.compute-mig-c.group.id },
]
}
}
}
# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-ab.tf inventory=classic-vs-non-classic.yaml e2e
# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf inventory=classic-vs-non-classic.yaml e2e
```

### Health Checks
Expand All @@ -221,7 +221,7 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [{
backend = module.compute-mig-a.group.id
backend = module.compute-mig-b.group.id
}]
# no need to reference the hc explicitly when using the `default` key
# health_checks = ["default"]
Expand All @@ -233,7 +233,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-ab.tf inventory=health-check-1.yaml e2e
# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf inventory=health-check-1.yaml e2e
```

To leverage existing health checks without having the module create them, simply pass their self links to backend services and set the `health_check_configs` variable to an empty map:
Expand All @@ -253,7 +253,7 @@ module "glb-0" {
}
health_check_configs = {}
}
# tftest modules=3 resources=8 fixtures=fixtures/compute-mig-ab.tf inventory=health-check-2.yaml
# tftest modules=3 resources=8 fixtures=fixtures/compute-mig-bc.tf inventory=health-check-2.yaml
```

### Backend Types and Management
Expand Down Expand Up @@ -284,7 +284,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-ab.tf inventory=instance-groups.yaml e2e
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=instance-groups.yaml e2e
```

#### Managed Instance Groups
Expand Down Expand Up @@ -440,7 +440,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=11 fixtures=fixtures/compute-mig-ab.tf inventory=zonal-neg-creation.yaml e2e
# tftest modules=3 resources=11 fixtures=fixtures/compute-mig-bc.tf inventory=zonal-neg-creation.yaml e2e
```

#### Hybrid NEG creation
Expand Down Expand Up @@ -636,12 +636,12 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [{
backend = module.compute-mig-a.group.id
backend = module.compute-mig-b.group.id
}]
}
other = {
backends = [{
backend = module.compute-mig-b.group.id
backend = module.compute-mig-c.group.id
}]
}
}
Expand All @@ -663,7 +663,7 @@ module "glb-0" {
}
}

# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-ab.tf inventory=url-map.yaml e2e
# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=url-map.yaml e2e
```

### SSL Certificates
Expand Down Expand Up @@ -699,8 +699,8 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [
{ backend = module.compute-mig-a.group.id },
{ backend = module.compute-mig-b.group.id },
{ backend = module.compute-mig-c.group.id },
]
protocol = "HTTP"
}
Expand All @@ -716,7 +716,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=12 fixtures=fixtures/compute-mig-ab.tf inventory=ssl-certificates.yaml e2e
# tftest modules=3 resources=12 fixtures=fixtures/compute-mig-bc.tf inventory=ssl-certificates.yaml e2e
```

### Complex example
Expand All @@ -736,14 +736,14 @@ module "glb-0" {
backend_service_configs = {
default = {
backends = [
{ backend = "ew4-a" },
{ backend = "ew4-b" },
{ backend = "group-zone-b" },
{ backend = "group-zone-c" },
]
}
neg-gce-0 = {
backends = [{
balancing_mode = "RATE"
backend = "neg-ew4-b"
backend = "neg-zone-c"
max_rate = { per_endpoint = 10 }
}]
}
Expand All @@ -758,17 +758,17 @@ module "glb-0" {
}
}
group_configs = {
ew4-a = {
zone = "${var.region}-a"
group-zone-b = {
zone = "${var.region}-b"
instances = [
module.compute-mig-a.id
module.compute-mig-b.id
]
named_ports = { http = 80 }
}
ew4-b = {
zone = "${var.region}-b"
group-zone-c = {
zone = "${var.region}-c"
instances = [
module.compute-mig-b.id
module.compute-mig-c.id
]
named_ports = { http = 80 }
}
Expand All @@ -787,15 +787,15 @@ module "glb-0" {
}
}
neg_configs = {
neg-ew4-b = {
neg-zone-c = {
gce = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
zone = "${var.region}-b"
zone = "${var.region}-c"
endpoints = {
e-0 = {
instance = "my-ig-b"
ip_address = module.compute-mig-b.internal_ip
instance = "my-ig-c"
ip_address = module.compute-mig-c.internal_ip
port = 80
}
}
Expand Down Expand Up @@ -849,7 +849,7 @@ module "glb-0" {
}
}
}
# tftest modules=3 resources=19 fixtures=fixtures/compute-mig-ab.tf inventory=complex-example.yaml e2e
# tftest modules=3 resources=19 fixtures=fixtures/compute-mig-bc.tf inventory=complex-example.yaml e2e
```

<!-- TFDOC OPTS files:1 -->
Expand Down Expand Up @@ -911,5 +911,5 @@ module "glb-0" {

## Fixtures

- [compute-mig-ab.tf](../../tests/fixtures/compute-mig-ab.tf)
- [compute-mig-bc.tf](../../tests/fixtures/compute-mig-bc.tf)
<!-- END TFDOC -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# 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.
Expand All @@ -13,11 +13,11 @@
# limitations under the License.


module "compute-mig-a" {
module "compute-mig-b" {
source = "./fabric/modules/compute-vm"
project_id = var.project_id
zone = "${var.region}-a"
name = "my-ig-a"
zone = "${var.region}-b"
name = "my-ig-b"
network_interfaces = [{
network = var.vpc.self_link
subnetwork = var.subnet.self_link
Expand All @@ -30,11 +30,11 @@ module "compute-mig-a" {
group = { named_ports = {} }
}

module "compute-mig-b" {
module "compute-mig-c" {
source = "./fabric/modules/compute-vm"
project_id = var.project_id
zone = "${var.region}-b"
name = "my-ig-b"
zone = "${var.region}-c"
name = "my-ig-c"
network_interfaces = [{
network = var.vpc.self_link
subnetwork = var.subnet.self_link
Expand Down
28 changes: 14 additions & 14 deletions tests/modules/net_lb_app_ext/examples/complex-example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# 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.
Expand Down Expand Up @@ -167,31 +167,31 @@ values:
timeout_sec: 5
timeouts: null
unhealthy_threshold: 2
module.glb-0.google_compute_instance_group.default["ew4-a"]:
module.glb-0.google_compute_instance_group.default["group-zone-b"]:
description: Terraform managed.
name: glb-test-0-ew4-a
name: glb-test-0-group-zone-b
named_port:
- name: http
port: 80
project: project-id
timeouts: null
zone: europe-west8-a
module.glb-0.google_compute_instance_group.default["ew4-b"]:
zone: europe-west8-b
module.glb-0.google_compute_instance_group.default["group-zone-c"]:
description: Terraform managed.
name: glb-test-0-ew4-b
name: glb-test-0-group-zone-c
named_port:
- name: http
port: 80
project: project-id
timeouts: null
zone: europe-west8-b
module.glb-0.google_compute_network_endpoint.default["neg-ew4-b-e-0"]:
instance: my-ig-b
network_endpoint_group: glb-test-0-neg-ew4-b
zone: europe-west8-c
module.glb-0.google_compute_network_endpoint.default["neg-zone-c-e-0"]:
instance: my-ig-c
network_endpoint_group: glb-test-0-neg-zone-c
port: 80
project: project-id
timeouts: null
zone: europe-west8-b
zone: europe-west8-c
module.glb-0.google_compute_network_endpoint.default["neg-hello-e-0"]:
instance: null
ip_address: 192.168.0.3
Expand All @@ -200,16 +200,16 @@ values:
project: project-id
timeouts: null
zone: europe-west8-b
module.glb-0.google_compute_network_endpoint_group.default["neg-ew4-b"]:
module.glb-0.google_compute_network_endpoint_group.default["neg-zone-c"]:
default_port: null
description: Terraform managed.
name: glb-test-0-neg-ew4-b
name: glb-test-0-neg-zone-c
network: projects/xxx/global/networks/aaa
network_endpoint_type: GCE_VM_IP_PORT
project: project-id
subnetwork: subnet_self_link
timeouts: null
zone: europe-west8-b
zone: europe-west8-c
module.glb-0.google_compute_network_endpoint_group.default["neg-hello"]:
default_port: null
description: Terraform managed.
Expand Down
Loading