Skip to content

Commit

Permalink
Fix variable region (#1953)
Browse files Browse the repository at this point in the history
This PR changes variable region's default value in example tests to real region value.

Some of the modules parse the region name to decide whether to create regional or zonal resources.
  • Loading branch information
andybubu authored Dec 28, 2023
1 parent 9d6e614 commit 2ad109a
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion tests/examples/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ variable "project_id" {
}

variable "region" {
default = "region"
default = "europe-west8"
}

variable "service_account" {
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/cloud_run/examples/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
values:
module.cloud_run.google_cloud_run_service.service:
autogenerate_revision_name: false
location: region
location: europe-west8
metadata:
- {}
name: hello
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/net_address/examples/internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ values:
network: null
project: project-id
purpose: SHARED_LOADBALANCER_VIP
region: region
region: europe-west8
subnetwork: subnet_self_link
module.addresses.google_compute_address.internal["ilb-2"]:
address: 10.0.0.2
Expand All @@ -29,7 +29,7 @@ values:
name: ilb-2
network: null
project: project-id
region: region
region: europe-west8
subnetwork: subnet_self_link

counts:
Expand Down
6 changes: 3 additions & 3 deletions tests/modules/net_address/examples/ipsec-interconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ values:
prefix_length: 29
project: project-id
purpose: IPSEC_INTERCONNECT
region: region
region: europe-west8
module.addresses.google_compute_address.ipsec_interconnect["vpn-gw-range-2"]:
address: 10.255.255.8
address_type: INTERNAL
Expand All @@ -30,7 +30,7 @@ values:
prefix_length: 29
project: project-id
purpose: IPSEC_INTERCONNECT
region: region
region: europe-west8

counts:
google_compute_address: 2
google_compute_address: 2
6 changes: 3 additions & 3 deletions tests/modules/net_address/examples/ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ values:
ipv6_endpoint_type: NETLB
name: nlb
project: project-id
region: region
region: europe-west8
module.addresses.google_compute_address.internal["ilb"]:
address_type: INTERNAL
ip_version: IPV6
Expand All @@ -28,7 +28,7 @@ values:
network: null
project: project-id
purpose: SHARED_LOADBALANCER_VIP
region: region
region: europe-west8
subnetwork: subnet_self_link
module.addresses.google_compute_address.internal["vm"]:
address_type: INTERNAL
Expand All @@ -37,7 +37,7 @@ values:
name: vm
network: null
project: project-id
region: region
region: europe-west8
subnetwork: subnet_self_link

counts:
Expand Down
10 changes: 5 additions & 5 deletions tests/modules/net_lb_ext/examples/dual_stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ values:
ports: null
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -46,7 +46,7 @@ values:
ports: null
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -68,7 +68,7 @@ values:
outlier_detection: []
project: project-id
protocol: UNSPECIFIED
region: region
region: europe-west8
security_policy: null
subsetting: []
timeouts: null
Expand All @@ -82,7 +82,7 @@ values:
https_health_check: []
name: nlb-test
project: project-id
region: region
region: europe-west8
ssl_health_check: []
tcp_health_check:
- port: null
Expand All @@ -100,4 +100,4 @@ counts:
google_compute_region_backend_service: 1
google_compute_region_health_check: 1
modules: 3
resources: 7
resources: 7
8 changes: 4 additions & 4 deletions tests/modules/net_lb_ext/examples/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ values:
- '80'
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -50,7 +50,7 @@ values:
outlier_detection: []
project: project-id
protocol: UNSPECIFIED
region: region
region: europe-west8
security_policy: null
subsetting: []
timeouts: null
Expand All @@ -71,7 +71,7 @@ values:
https_health_check: []
name: nlb-test
project: project-id
region: region
region: europe-west8
ssl_health_check: []
tcp_health_check: []
timeout_sec: 5
Expand All @@ -83,4 +83,4 @@ counts:
google_compute_region_backend_service: 1
google_compute_region_health_check: 1
modules: 3
resources: 7
resources: 7
10 changes: 5 additions & 5 deletions tests/modules/net_lb_ext/examples/ext_migs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ values:
ports: null
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -38,7 +38,7 @@ values:
named_port: []
project: project-id
timeouts: null
zone: region-b
zone: europe-west8-b
module.nlb.google_compute_region_backend_service.default:
affinity_cookie_ttl_sec: null
circuit_breakers: []
Expand All @@ -56,7 +56,7 @@ values:
outlier_detection: []
project: project-id
protocol: UNSPECIFIED
region: region
region: europe-west8
security_policy: null
subsetting: []
timeouts: null
Expand All @@ -77,7 +77,7 @@ values:
https_health_check: []
name: nlb-test
project: project-id
region: region
region: europe-west8
ssl_health_check: []
tcp_health_check: []
timeout_sec: 5
Expand All @@ -90,4 +90,4 @@ counts:
google_compute_region_backend_service: 1
google_compute_region_health_check: 1
modules: 3
resources: 6
resources: 6
12 changes: 6 additions & 6 deletions tests/modules/net_lb_ext/examples/fwd_rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ values:
ports: null
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -47,7 +47,7 @@ values:
- '80'
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -58,7 +58,7 @@ values:
named_port: []
project: project-id
timeouts: null
zone: region-b
zone: europe-west8-b
module.nlb.google_compute_region_backend_service.default:
affinity_cookie_ttl_sec: null
circuit_breakers: []
Expand All @@ -76,7 +76,7 @@ values:
outlier_detection: []
project: project-id
protocol: UNSPECIFIED
region: region
region: europe-west8
security_policy: null
subsetting: []
timeouts: null
Expand All @@ -90,7 +90,7 @@ values:
https_health_check: []
name: nlb-test
project: project-id
region: region
region: europe-west8
ssl_health_check: []
tcp_health_check:
- port: null
Expand All @@ -109,4 +109,4 @@ counts:
google_compute_region_backend_service: 1
google_compute_region_health_check: 1
modules: 3
resources: 7
resources: 7
8 changes: 4 additions & 4 deletions tests/modules/net_lb_ext/examples/migs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ values:
ports: null
project: project-id
recreate_closed_psc: false
region: region
region: europe-west8
service_label: null
source_ip_ranges: null
target: null
Expand All @@ -49,7 +49,7 @@ values:
outlier_detection: []
project: project-id
protocol: UNSPECIFIED
region: region
region: europe-west8
security_policy: null
subsetting: []
timeouts: null
Expand All @@ -70,7 +70,7 @@ values:
https_health_check: []
name: nlb-test
project: project-id
region: region
region: europe-west8
ssl_health_check: []
tcp_health_check: []
timeout_sec: 5
Expand All @@ -83,4 +83,4 @@ counts:
google_compute_region_health_check: 1
google_service_account: 1
modules: 3
resources: 6
resources: 6
16 changes: 8 additions & 8 deletions tests/modules/net_vpn_ha/examples/gcp-to-onprem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ values:
name: mynet-to-onprem
network: projects/xxx/global/networks/aaa
project: project-id
region: region
region: europe-west8
stack_type: IPV4_ONLY
module.vpn_ha.google_compute_router.router[0]:
bgp:
Expand All @@ -40,14 +40,14 @@ values:
name: vpn-mynet-to-onprem
network: projects/xxx/global/networks/aaa
project: project-id
region: region
region: europe-west8
module.vpn_ha.google_compute_router_interface.router_interface["remote-0"]:
interconnect_attachment: null
ip_range: 169.254.1.2/30
name: mynet-to-onprem-remote-0
private_ip_address: null
project: project-id
region: region
region: europe-west8
router: vpn-mynet-to-onprem
subnetwork: null
vpn_tunnel: mynet-to-onprem-remote-0
Expand All @@ -57,7 +57,7 @@ values:
name: mynet-to-onprem-remote-1
private_ip_address: null
project: project-id
region: region
region: europe-west8
router: vpn-mynet-to-onprem
subnetwork: null
vpn_tunnel: mynet-to-onprem-remote-1
Expand All @@ -73,7 +73,7 @@ values:
peer_asn: 64513
peer_ip_address: 169.254.1.1
project: project-id
region: region
region: europe-west8
router: vpn-mynet-to-onprem
router_appliance_instance: null
module.vpn_ha.google_compute_router_peer.bgp_peer["remote-1"]:
Expand All @@ -88,7 +88,7 @@ values:
peer_asn: 64513
peer_ip_address: 169.254.2.1
project: project-id
region: region
region: europe-west8
router: vpn-mynet-to-onprem
router_appliance_instance: null
module.vpn_ha.google_compute_vpn_tunnel.tunnels["remote-0"]:
Expand All @@ -98,7 +98,7 @@ values:
peer_external_gateway_interface: 0
peer_gcp_gateway: null
project: project-id
region: region
region: europe-west8
router: vpn-mynet-to-onprem
shared_secret: mySecret
target_vpn_gateway: null
Expand All @@ -110,7 +110,7 @@ values:
peer_external_gateway_interface: 0
peer_gcp_gateway: null
project: project-id
region: region
region: europe-west8
router: vpn-mynet-to-onprem
shared_secret: mySecret
target_vpn_gateway: null
Expand Down
8 changes: 4 additions & 4 deletions tests/modules/workstation_cluster/examples/custom-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ values:
env: null
labels:
team: my-team
location: region
location: europe-west8
project: project-id
terraform_labels:
team: my-team
Expand All @@ -34,7 +34,7 @@ values:
display_name: null
domain_config: []
labels: null
location: region
location: europe-west8
network: projects/xxx/global/networks/aaa
private_cluster_config:
- enable_private_endpoint: false
Expand Down Expand Up @@ -62,7 +62,7 @@ values:
encryption_key: []
idle_timeout: 1200s
labels: null
location: region
location: europe-west8
project: project-id
running_timeout: 43200s
timeouts: null
Expand All @@ -74,4 +74,4 @@ counts:
google_workstations_workstation_cluster: 1
google_workstations_workstation_config: 1
modules: 1
resources: 3
resources: 3
Loading

0 comments on commit 2ad109a

Please sign in to comment.