feat(alloydb): add support for advanced query insights (observability_config) (#3856)

* Implemented advanced query insight in alloydb module

* Implemented readme example and test

* Fix TOC
This commit is contained in:
Samuele Perticarari
2026-04-11 13:57:38 +02:00
committed by GitHub
parent 8b2fb39efe
commit 55a847c008
4 changed files with 430 additions and 25 deletions

View File

@@ -0,0 +1,268 @@
# 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.
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: []
labels: null
location: europe-west8
maintenance_update_policy: []
network_config:
- allocated_ip_range: null
project: test-alloydb
psc_config: []
restore_backup_source: []
restore_backupdr_backup_source: []
restore_backupdr_pitr_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
connection_pool_config: []
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
observability_config:
- assistive_experiences_enabled: true
enabled: true
max_query_string_length: 20480
preserve_comments: true
query_plans_per_minute: 30
record_application_tags: true
track_active_queries: true
track_wait_events: true
read_pool_config: []
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.alloydb.google_alloydb_instance.read_pool_primary["regional-read-pool"]:
annotations: null
connection_pool_config: []
display_name: regional-read-pool
effective_labels:
goog-terraform-provisioned: 'true'
gce_zone: null
instance_id: regional-read-pool
instance_type: READ_POOL
labels: null
machine_config:
- cpu_count: 2
observability_config:
- assistive_experiences_enabled: true
enabled: true
max_query_string_length: 20480
preserve_comments: true
query_plans_per_minute: 30
record_application_tags: true
track_active_queries: true
track_wait_events: true
read_pool_config:
- node_count: 2
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.project.google_project.project[0]:
auto_create_network: false
billing_account: 123456-123456-123456
deletion_policy: DELETE
effective_labels:
goog-terraform-provisioned: 'true'
folder_id: '1122334455'
labels: null
name: test-alloydb
org_id: null
project_id: test-alloydb
tags: null
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.project.google_project_iam_member.service_agents["alloydb"]:
condition: []
project: test-alloydb
role: roles/alloydb.serviceAgent
module.project.google_project_iam_member.service_agents["service-networking"]:
condition: []
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
service: alloydb.googleapis.com
timeouts: null
module.project.google_project_service.project_services["geminicloudassist.googleapis.com"]:
disable_dependent_services: false
disable_on_destroy: false
project: test-alloydb
service: geminicloudassist.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
service: servicenetworking.googleapis.com
timeouts: null
module.project.google_project_service_identity.default["alloydb.googleapis.com"]:
project: test-alloydb
service: alloydb.googleapis.com
timeouts: null
module.project.google_project_service_identity.default["servicenetworking.googleapis.com"]:
project: test-alloydb
service: servicenetworking.googleapis.com
timeouts: null
module.vpc.google_compute_global_address.psa_ranges["servicenetworking-googleapis-com-alloydb"]:
address: 10.60.0.0
address_type: INTERNAL
description: null
effective_labels:
goog-terraform-provisioned: 'true'
ip_version: null
labels: null
name: servicenetworking-googleapis-com-alloydb
prefix_length: 16
project: test-alloydb
purpose: VPC_PEERING
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.vpc.google_compute_network.network[0]:
auto_create_subnetworks: false
delete_bgp_always_compare_med: false
delete_default_routes_on_create: false
description: Terraform-managed.
enable_ula_internal_ipv6: null
name: my-network
network_firewall_policy_enforcement_order: AFTER_CLASSIC_FIREWALL
network_profile: null
params: []
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
timeouts: null
module.vpc.google_compute_route.gateway["directpath-googleapis"]:
description: Terraform-managed.
dest_range: 34.126.0.0/18
name: my-network-directpath-googleapis
network: my-network
next_hop_gateway: default-internet-gateway
next_hop_ilb: null
next_hop_instance: null
next_hop_vpn_tunnel: null
params: []
priority: 1000
project: test-alloydb
tags: null
timeouts: null
module.vpc.google_compute_route.gateway["private-googleapis"]:
description: Terraform-managed.
dest_range: 199.36.153.8/30
name: my-network-private-googleapis
network: my-network
next_hop_gateway: default-internet-gateway
next_hop_ilb: null
next_hop_instance: null
next_hop_vpn_tunnel: null
params: []
priority: 1000
project: test-alloydb
tags: null
timeouts: null
module.vpc.google_compute_route.gateway["restricted-googleapis"]:
description: Terraform-managed.
dest_range: 199.36.153.4/30
name: my-network-restricted-googleapis
network: my-network
next_hop_gateway: default-internet-gateway
next_hop_ilb: null
next_hop_instance: null
next_hop_vpn_tunnel: null
params: []
priority: 1000
project: test-alloydb
tags: null
timeouts: null
module.vpc.google_compute_subnetwork.psc["europe-west8/psc"]:
description: Terraform-managed subnet for Private Service Connect (PSC NAT).
ip_cidr_range: 10.0.3.0/24
ip_collection: null
ipv6_access_type: null
log_config: []
name: psc
network: my-network
params: []
project: test-alloydb
purpose: PRIVATE_SERVICE_CONNECT
region: europe-west8
reserved_internal_range: null
resolve_subnet_mask: null
role: null
send_secondary_ip_range_if_empty: null
timeouts: null
module.vpc.google_service_networking_connection.psa_connection["servicenetworking.googleapis.com"]:
deletion_policy: null
reserved_peering_ranges:
- servicenetworking-googleapis-com-alloydb
service: servicenetworking.googleapis.com
timeouts: null
update_on_creation_fail: null
counts:
google_alloydb_cluster: 1
google_alloydb_instance: 2
google_compute_global_address: 1
google_compute_network_peering_routes_config: 1
google_compute_network: 1
google_compute_route: 3
google_compute_subnetwork: 1
google_project_iam_member: 2
google_project_service_identity: 2
google_project_service: 3
google_project: 1
google_service_networking_connection: 1
modules: 3
resources: 19
outputs: {}