Skip to content

Commit

Permalink
Fixes for Alloydb E2E tests (#2312)
Browse files Browse the repository at this point in the history
* Fixes for Alloydb E2E tests

* too long project name in Sipmle example resulted in:
```
Error: "***-alloydb-prj" name must be 4 to 30 characters with lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point.
```

* using self_link resulted in:
```
Error: Error creating Cluster: googleapi: Error 499: malformed network path: "https://www.googleapis.com/compute/v1/projects/***/global/networks/e2e-test"
```

* Cross region replication stil fails with:
```
│ Error: Error creating cluster. Can not create secondary cluster without secondary_config field.
│
│   with module.alloydb.google_alloydb_cluster.secondary[0],
│   on /usr/local/google/home/wiktorn/git/cloud-foundation-fabric/modules/alloydb/main.tf line 199, in resource "google_alloydb_cluster" "secondary":
│  199: resource "google_alloydb_cluster" "secondary" {
```

* Fix tests

---------

Co-authored-by: Julio Castillo <[email protected]>
  • Loading branch information
wiktorn and juliocc authored May 29, 2024
1 parent c205a69 commit d1ec3b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions modules/alloydb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "project" {
source = "./fabric/modules/project"
billing_account = var.billing_account_id
parent = var.folder_id
name = "alloydb-prj"
name = "alloydb"
prefix = var.prefix
services = [
"servicenetworking.googleapis.com",
Expand Down Expand Up @@ -76,7 +76,7 @@ module "alloydb" {
location = var.region
name = "db"
network_config = {
network = var.vpc.self_link
network = var.vpc.id
}
cross_region_replication = {
enabled = true
Expand Down Expand Up @@ -104,7 +104,7 @@ module "alloydb" {
timezone = "'UTC'"
}
network_config = {
network = var.vpc.self_link
network = var.vpc.id
}
users = {
# generate a password for user1
Expand All @@ -130,7 +130,7 @@ module "alloydb" {
location = var.region
name = "primary"
network_config = {
network = var.vpc.self_link
network = var.vpc.id
}
encryption_config = {
primary_kms_key_name = var.kms_key.id
Expand Down
26 changes: 13 additions & 13 deletions tests/modules/alloydb/examples/simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ values:
maintenance_update_policy: []
network_config:
- allocated_ip_range: null
project: test-alloydb-prj
project: test-alloydb
restore_backup_source: []
restore_continuous_backup_source: []
secondary_config: []
Expand Down Expand Up @@ -62,29 +62,29 @@ values:
billing_account: 123456-123456-123456
folder_id: '1122334455'
labels: null
name: test-alloydb-prj
name: test-alloydb
org_id: null
project_id: test-alloydb-prj
project_id: test-alloydb
skip_delete: false
timeouts: null
module.project.google_project_iam_member.servicenetworking[0]:
condition: []
project: test-alloydb-prj
project: test-alloydb
role: roles/servicenetworking.serviceAgent
module.project.google_project_service.project_services["alloydb.googleapis.com"]:
disable_dependent_services: false
disable_on_destroy: false
project: test-alloydb-prj
project: test-alloydb
service: alloydb.googleapis.com
timeouts: null
module.project.google_project_service.project_services["servicenetworking.googleapis.com"]:
disable_dependent_services: false
disable_on_destroy: false
project: test-alloydb-prj
project: test-alloydb
service: servicenetworking.googleapis.com
timeouts: null
module.project.google_project_service_identity.servicenetworking[0]:
project: test-alloydb-prj
project: test-alloydb
service: servicenetworking.googleapis.com
timeouts: null
module.vpc.google_compute_global_address.psa_ranges["servicenetworking-googleapis-com-alloydb"]:
Expand All @@ -94,7 +94,7 @@ values:
ip_version: null
name: servicenetworking-googleapis-com-alloydb
prefix_length: 16
project: test-alloydb-prj
project: test-alloydb
purpose: VPC_PEERING
timeouts: null
module.vpc.google_compute_network.network[0]:
Expand All @@ -104,14 +104,14 @@ values:
enable_ula_internal_ipv6: null
name: my-network
network_firewall_policy_enforcement_order: AFTER_CLASSIC_FIREWALL
project: test-alloydb-prj
project: test-alloydb
routing_mode: GLOBAL
timeouts: null
module.vpc.google_compute_network_peering_routes_config.psa_routes["servicenetworking.googleapis.com"]:
export_custom_routes: false
import_custom_routes: false
network: my-network
project: test-alloydb-prj
project: test-alloydb
timeouts: null
module.vpc.google_compute_route.gateway["private-googleapis"]:
description: Terraform-managed.
Expand All @@ -123,7 +123,7 @@ values:
next_hop_instance: null
next_hop_vpn_tunnel: null
priority: 1000
project: test-alloydb-prj
project: test-alloydb
tags: null
timeouts: null
module.vpc.google_compute_route.gateway["restricted-googleapis"]:
Expand All @@ -136,7 +136,7 @@ values:
next_hop_instance: null
next_hop_vpn_tunnel: null
priority: 1000
project: test-alloydb-prj
project: test-alloydb
tags: null
timeouts: null
module.vpc.google_compute_subnetwork.psc["europe-west8/psc"]:
Expand All @@ -146,7 +146,7 @@ values:
log_config: []
name: psc
network: my-network
project: test-alloydb-prj
project: test-alloydb
purpose: PRIVATE_SERVICE_CONNECT
region: europe-west8
role: null
Expand Down

0 comments on commit d1ec3b0

Please sign in to comment.