Add optional secondary read pool support to the alloydb module (#3529)

* Add optinal secondary read pool support to the alloydb module

* Fix formatting

---------

Co-authored-by: Julio Castillo <jccb@google.com>
This commit is contained in:
Sergey Shcherbakov
2025-11-19 00:15:42 +01:00
committed by GitHub
parent acf2634831
commit 844ef0b44f
6 changed files with 367 additions and 40 deletions

View File

@@ -0,0 +1,166 @@
# Copyright 2025 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:
module.alloydb.google_alloydb_cluster.primary:
annotations: null
cluster_id: db
cluster_type: PRIMARY
continuous_backup_config:
- enabled: true
encryption_config: []
recovery_window_days: 14
database_version: POSTGRES_15
deletion_policy: DEFAULT
deletion_protection: false
display_name: db
effective_labels:
goog-terraform-provisioned: 'true'
encryption_config: []
etag: null
initial_user:
- password: changeit
user: postgres
labels: null
location: europe-west8
maintenance_update_policy: []
network_config:
- allocated_ip_range: null
network: projects/xxx/global/networks/aaa
project: project-id
psc_config: []
restore_backup_source: []
restore_continuous_backup_source: []
secondary_config: []
skip_await_major_version_upgrade: true
subscription_type: STANDARD
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.alloydb.google_alloydb_cluster.secondary[0]:
annotations: null
cluster_id: db-sec
cluster_type: SECONDARY
continuous_backup_config:
- enabled: true
encryption_config: []
recovery_window_days: 14
database_version: POSTGRES_15
deletion_policy: FORCE
deletion_protection: false
display_name: db-sec
effective_labels:
goog-terraform-provisioned: 'true'
encryption_config: []
etag: null
initial_user: []
labels: null
location: europe-west12
maintenance_update_policy: []
network_config:
- allocated_ip_range: null
network: projects/xxx/global/networks/aaa
project: project-id
psc_config: []
restore_backup_source: []
restore_continuous_backup_source: []
secondary_config:
- {}
skip_await_major_version_upgrade: true
subscription_type: STANDARD
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.alloydb.google_alloydb_instance.primary:
annotations: null
availability_type: REGIONAL
display_name: db
effective_labels:
goog-terraform-provisioned: 'true'
gce_zone: null
instance_id: db
instance_type: PRIMARY
labels: null
machine_config:
- cpu_count: 2
query_insights_config:
- query_plans_per_minute: 5
query_string_length: 1024
record_application_tags: true
record_client_address: true
read_pool_config: []
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.alloydb.google_alloydb_instance.read_pool_primary["primary-read-pool"]:
annotations: null
display_name: primary-read-pool
effective_labels:
goog-terraform-provisioned: 'true'
gce_zone: null
instance_id: primary-read-pool
instance_type: READ_POOL
labels: null
machine_config:
- cpu_count: 2
read_pool_config:
- node_count: 1
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.alloydb.google_alloydb_instance.read_pool_secondary["secondary-read-pool"]:
annotations: null
display_name: secondary-read-pool
effective_labels:
goog-terraform-provisioned: 'true'
gce_zone: null
instance_id: secondary-read-pool
instance_type: READ_POOL
labels: null
machine_config:
- cpu_count: 2
read_pool_config:
- node_count: 1
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.alloydb.google_alloydb_instance.secondary[0]:
annotations: null
availability_type: REGIONAL
display_name: db-sec
effective_labels:
goog-terraform-provisioned: 'true'
gce_zone: null
instance_id: db-sec
instance_type: SECONDARY
labels: null
machine_config:
- cpu_count: 2
query_insights_config:
- query_plans_per_minute: 5
query_string_length: 1024
record_application_tags: true
record_client_address: true
read_pool_config: []
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
counts:
google_alloydb_cluster: 2
google_alloydb_instance: 4
modules: 1
resources: 6
outputs: {}

View File

@@ -60,7 +60,7 @@ values:
record_client_address: true
read_pool_config: []
timeouts: null
module.alloydb.google_alloydb_instance.read_pool["regional-read-pool"]:
module.alloydb.google_alloydb_instance.read_pool_primary["regional-read-pool"]:
annotations: null
display_name: regional-read-pool
gce_zone: null
@@ -72,7 +72,7 @@ values:
read_pool_config:
- node_count: 2
timeouts: null
module.alloydb.google_alloydb_instance.read_pool["zonal-read-pool"]:
module.alloydb.google_alloydb_instance.read_pool_primary["zonal-read-pool"]:
annotations: null
display_name: zonal-read-pool
effective_labels: