From f67162087da85ea2460ecf2bbd46c3377501b8ee Mon Sep 17 00:00:00 2001 From: Xuebao Zhao Date: Tue, 17 Jun 2025 22:24:47 +0000 Subject: [PATCH 1/5] feat(cloud_sql): add MCP instances examples --- cloud_sql/mysql_instance_mcp/main.tf | 89 +++++++++++++++++++++++ cloud_sql/mysql_instance_mcp/test.yaml | 20 +++++ cloud_sql/postgres_instance_mcp/main.tf | 86 ++++++++++++++++++++++ cloud_sql/postgres_instance_mcp/test.yaml | 20 +++++ 4 files changed, 215 insertions(+) create mode 100644 cloud_sql/mysql_instance_mcp/main.tf create mode 100644 cloud_sql/mysql_instance_mcp/test.yaml create mode 100644 cloud_sql/postgres_instance_mcp/main.tf create mode 100644 cloud_sql/postgres_instance_mcp/test.yaml diff --git a/cloud_sql/mysql_instance_mcp/main.tf b/cloud_sql/mysql_instance_mcp/main.tf new file mode 100644 index 00000000..5cf7e96c --- /dev/null +++ b/cloud_sql/mysql_instance_mcp/main.tf @@ -0,0 +1,89 @@ +/** + * 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. + */ + +# [START cloud_sql_mysql_instance_mcp_creation] +resource "google_sql_database_instance" "mysql_mcp_creation" { + name = "mysql-instance-mcp-creation" + region = "us-central1" + database_version = "MYSQL_8_0" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + connection_pooling_enabled = true + } + } +} +# [END cloud_sql_mysql_instance_mcp_creation] + +# [START cloud_sql_mysql_instance_mcp_enable] +# This example shows creating an instance with MCP enabled and custom flags set. +resource "google_sql_database_instance" "mysql_mcp_enable" { + name = "mysql-instance-mcp-enable" + region = "us-central1" + database_version = "MYSQL_8_0" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + connection_pooling_enabled = true + } + } +} +# [END cloud_sql_mysql_instance_mcp_enable] + +# [START cloud_sql_mysql_instance_mcp_modify] +# This example shows modifying the flags of an existing MCP configuration. +resource "google_sql_database_instance" "mysql_mcp_modify" { + name = "mysql-instance-mcp-modify" + region = "us-central1" + database_version = "MYSQL_8_0" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + connection_pooling_enabled = true + flags { + name = "max_client_connections" # Modify or add the value of an flag + value = "1980" + } + } + } +} +# [END cloud_sql_mysql_instance_mcp_modify] + +# [START cloud_sql_mysql_instance_mcp_disable] +# This example shows disabling MCP on an existing instance. +resource "google_sql_database_instance" "mysql_mcp_disable" { + name = "mysql-instance-mcp-disable" + region = "us-central1" + database_version = "MYSQL_8_0" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + # Set to false to disable MCP. You can also remove the block entirely. + connection_pooling_enabled = false + } + } +} +# [END cloud_sql_mysql_instance_mcp_disable] + +# [START cloud_sql_mysql_instance_mcp_view] +# To view the current status, you can use the `terraform show` command after applying +# your configuration. The `connection_pool_config` block will reflect the current state. +terraform show +# [END cloud_sql_mysql_instance_mcp_view] \ No newline at end of file diff --git a/cloud_sql/mysql_instance_mcp/test.yaml b/cloud_sql/mysql_instance_mcp/test.yaml new file mode 100644 index 00000000..17ef0c92 --- /dev/null +++ b/cloud_sql/mysql_instance_mcp/test.yaml @@ -0,0 +1,20 @@ +# 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. + +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintTest +metadata: + name: sql_mysql_instance_mcp +spec: + skip: true diff --git a/cloud_sql/postgres_instance_mcp/main.tf b/cloud_sql/postgres_instance_mcp/main.tf new file mode 100644 index 00000000..f9a5ce6d --- /dev/null +++ b/cloud_sql/postgres_instance_mcp/main.tf @@ -0,0 +1,86 @@ +/** + * 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. + */ + +# [START cloud_sql_postgres_instance_mcp_creation] +resource "google_sql_database_instance" "postgres_mcp_creation" { + name = "postgres-instance-mcp-creation" + region = "us-central1" + database_version = "POSTGRES_16" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + connection_pooling_enabled = true + } + } +} +# [END cloud_sql_postgres_instance_mcp_creation] + +# [START cloud_sql_postgres_instance_mcp_enable] +resource "google_sql_database_instance" "postgres_mcp_enable" { + name = "postgres-instance-mcp-enable" + region = "us-central1" + database_version = "POSTGRES_16" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + connection_pooling_enabled = true # Set to true here + } + } +} +# [END cloud_sql_postgres_instance_mcp_enable] + +# [START cloud_sql_postgres_instance_mcp_modify] +resource "google_sql_database_instance" "postgres_mcp_modify" { + name = "postgres-instance-mcp-modify" + region = "us-central1" + database_version = "POSTGRES_16" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + connection_pooling_enabled = true + flags { + name = "max_client_connections" # Modify the value of an existing flag + value = "2000" + } + } + } +} +# [END cloud_sql_postgres_instance_mcp_modify] + +# [START cloud_sql_postgres_instance_mcp_disable] +resource "google_sql_database_instance" "postgres_mcp_disable" { + name = "postgres-instance-mcp-disable" + region = "us-central1" + database_version = "POSTGRES_16" + + settings { + tier = "db-perf-optimized-N-2" + connection_pool_config { + # Set to false to disable MCP. You can also remove the block entirely. + connection_pooling_enabled = false + } + } +} +# [END cloud_sql_postgres_instance_mcp_disable] + +# [START cloud_sql_postgres_instance_mcp_view] +# To view the current status, you can use the `terraform show` command after applying +# your configuration. The `connection_pool_config` block will reflect the current state. +terraform show +# [END cloud_sql_postgres_instance_mcp_view] \ No newline at end of file diff --git a/cloud_sql/postgres_instance_mcp/test.yaml b/cloud_sql/postgres_instance_mcp/test.yaml new file mode 100644 index 00000000..512e4d7d --- /dev/null +++ b/cloud_sql/postgres_instance_mcp/test.yaml @@ -0,0 +1,20 @@ +# 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. + +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintTest +metadata: + name: sql_postgres_instance_mcp +spec: + skip: true From bd185679db28dbfc734c54404e55fe28f78104ae Mon Sep 17 00:00:00 2001 From: xuebaoZ Date: Wed, 18 Jun 2025 08:59:29 +0000 Subject: [PATCH 2/5] feat(cloud_sql): add MCP instances examples --- .terraform.lock | 0 cloud_sql/mysql_instance_mcp/main.tf | 26 +++++++++++++------------ cloud_sql/postgres_instance_mcp/main.tf | 16 ++++++++------- 3 files changed, 23 insertions(+), 19 deletions(-) create mode 100644 .terraform.lock diff --git a/.terraform.lock b/.terraform.lock new file mode 100644 index 00000000..e69de29b diff --git a/cloud_sql/mysql_instance_mcp/main.tf b/cloud_sql/mysql_instance_mcp/main.tf index 5cf7e96c..bbf1ffea 100644 --- a/cloud_sql/mysql_instance_mcp/main.tf +++ b/cloud_sql/mysql_instance_mcp/main.tf @@ -19,9 +19,11 @@ resource "google_sql_database_instance" "mysql_mcp_creation" { name = "mysql-instance-mcp-creation" region = "us-central1" database_version = "MYSQL_8_0" + deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true } @@ -35,9 +37,11 @@ resource "google_sql_database_instance" "mysql_mcp_enable" { name = "mysql-instance-mcp-enable" region = "us-central1" database_version = "MYSQL_8_0" + deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true } @@ -51,14 +55,16 @@ resource "google_sql_database_instance" "mysql_mcp_modify" { name = "mysql-instance-mcp-modify" region = "us-central1" database_version = "MYSQL_8_0" + deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true flags { - name = "max_client_connections" # Modify or add the value of an flag - value = "1980" + name = "max_pool_size" # Modify or add the name and value of an flag + value = "10" } } } @@ -71,9 +77,11 @@ resource "google_sql_database_instance" "mysql_mcp_disable" { name = "mysql-instance-mcp-disable" region = "us-central1" database_version = "MYSQL_8_0" + deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { # Set to false to disable MCP. You can also remove the block entirely. connection_pooling_enabled = false @@ -81,9 +89,3 @@ resource "google_sql_database_instance" "mysql_mcp_disable" { } } # [END cloud_sql_mysql_instance_mcp_disable] - -# [START cloud_sql_mysql_instance_mcp_view] -# To view the current status, you can use the `terraform show` command after applying -# your configuration. The `connection_pool_config` block will reflect the current state. -terraform show -# [END cloud_sql_mysql_instance_mcp_view] \ No newline at end of file diff --git a/cloud_sql/postgres_instance_mcp/main.tf b/cloud_sql/postgres_instance_mcp/main.tf index f9a5ce6d..c64a8ea5 100644 --- a/cloud_sql/postgres_instance_mcp/main.tf +++ b/cloud_sql/postgres_instance_mcp/main.tf @@ -19,9 +19,11 @@ resource "google_sql_database_instance" "postgres_mcp_creation" { name = "postgres-instance-mcp-creation" region = "us-central1" database_version = "POSTGRES_16" + deletion_protection = false settings { tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true } @@ -34,9 +36,11 @@ resource "google_sql_database_instance" "postgres_mcp_enable" { name = "postgres-instance-mcp-enable" region = "us-central1" database_version = "POSTGRES_16" + deletion_protection = false settings { tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true # Set to true here } @@ -49,13 +53,15 @@ resource "google_sql_database_instance" "postgres_mcp_modify" { name = "postgres-instance-mcp-modify" region = "us-central1" database_version = "POSTGRES_16" + deletion_protection = false settings { tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true flags { - name = "max_client_connections" # Modify the value of an existing flag + name = "max_pool_size" # Modify the value of an existing flag value = "2000" } } @@ -68,9 +74,11 @@ resource "google_sql_database_instance" "postgres_mcp_disable" { name = "postgres-instance-mcp-disable" region = "us-central1" database_version = "POSTGRES_16" + deletion_protection = false settings { tier = "db-perf-optimized-N-2" + edition = "ENTERPRISE_PLUS" connection_pool_config { # Set to false to disable MCP. You can also remove the block entirely. connection_pooling_enabled = false @@ -78,9 +86,3 @@ resource "google_sql_database_instance" "postgres_mcp_disable" { } } # [END cloud_sql_postgres_instance_mcp_disable] - -# [START cloud_sql_postgres_instance_mcp_view] -# To view the current status, you can use the `terraform show` command after applying -# your configuration. The `connection_pool_config` block will reflect the current state. -terraform show -# [END cloud_sql_postgres_instance_mcp_view] \ No newline at end of file From 4a436f3db3c0b36c82cf66faca6fa1de0368f35b Mon Sep 17 00:00:00 2001 From: xuebaoZ Date: Wed, 18 Jun 2025 08:59:29 +0000 Subject: [PATCH 3/5] feat(cloud_sql): add MCP instances examples --- cloud_sql/mysql_instance_mcp/main.tf | 32 +++++++++++------------ cloud_sql/postgres_instance_mcp/main.tf | 34 ++++++++++++------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/cloud_sql/mysql_instance_mcp/main.tf b/cloud_sql/mysql_instance_mcp/main.tf index bbf1ffea..b3bbf8b1 100644 --- a/cloud_sql/mysql_instance_mcp/main.tf +++ b/cloud_sql/mysql_instance_mcp/main.tf @@ -16,13 +16,13 @@ # [START cloud_sql_mysql_instance_mcp_creation] resource "google_sql_database_instance" "mysql_mcp_creation" { - name = "mysql-instance-mcp-creation" - region = "us-central1" - database_version = "MYSQL_8_0" + name = "mysql-instance-mcp-creation" + region = "us-central1" + database_version = "MYSQL_8_0" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true @@ -34,13 +34,13 @@ resource "google_sql_database_instance" "mysql_mcp_creation" { # [START cloud_sql_mysql_instance_mcp_enable] # This example shows creating an instance with MCP enabled and custom flags set. resource "google_sql_database_instance" "mysql_mcp_enable" { - name = "mysql-instance-mcp-enable" - region = "us-central1" - database_version = "MYSQL_8_0" + name = "mysql-instance-mcp-enable" + region = "us-central1" + database_version = "MYSQL_8_0" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true @@ -52,13 +52,13 @@ resource "google_sql_database_instance" "mysql_mcp_enable" { # [START cloud_sql_mysql_instance_mcp_modify] # This example shows modifying the flags of an existing MCP configuration. resource "google_sql_database_instance" "mysql_mcp_modify" { - name = "mysql-instance-mcp-modify" - region = "us-central1" - database_version = "MYSQL_8_0" + name = "mysql-instance-mcp-modify" + region = "us-central1" + database_version = "MYSQL_8_0" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true @@ -74,13 +74,13 @@ resource "google_sql_database_instance" "mysql_mcp_modify" { # [START cloud_sql_mysql_instance_mcp_disable] # This example shows disabling MCP on an existing instance. resource "google_sql_database_instance" "mysql_mcp_disable" { - name = "mysql-instance-mcp-disable" - region = "us-central1" - database_version = "MYSQL_8_0" + name = "mysql-instance-mcp-disable" + region = "us-central1" + database_version = "MYSQL_8_0" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { # Set to false to disable MCP. You can also remove the block entirely. diff --git a/cloud_sql/postgres_instance_mcp/main.tf b/cloud_sql/postgres_instance_mcp/main.tf index c64a8ea5..7475f958 100644 --- a/cloud_sql/postgres_instance_mcp/main.tf +++ b/cloud_sql/postgres_instance_mcp/main.tf @@ -16,13 +16,13 @@ # [START cloud_sql_postgres_instance_mcp_creation] resource "google_sql_database_instance" "postgres_mcp_creation" { - name = "postgres-instance-mcp-creation" - region = "us-central1" - database_version = "POSTGRES_16" + name = "postgres-instance-mcp-creation" + region = "us-central1" + database_version = "POSTGRES_16" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true @@ -33,13 +33,13 @@ resource "google_sql_database_instance" "postgres_mcp_creation" { # [START cloud_sql_postgres_instance_mcp_enable] resource "google_sql_database_instance" "postgres_mcp_enable" { - name = "postgres-instance-mcp-enable" - region = "us-central1" - database_version = "POSTGRES_16" + name = "postgres-instance-mcp-enable" + region = "us-central1" + database_version = "POSTGRES_16" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true # Set to true here @@ -50,19 +50,19 @@ resource "google_sql_database_instance" "postgres_mcp_enable" { # [START cloud_sql_postgres_instance_mcp_modify] resource "google_sql_database_instance" "postgres_mcp_modify" { - name = "postgres-instance-mcp-modify" - region = "us-central1" - database_version = "POSTGRES_16" + name = "postgres-instance-mcp-modify" + region = "us-central1" + database_version = "POSTGRES_16" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { connection_pooling_enabled = true flags { name = "max_pool_size" # Modify the value of an existing flag - value = "2000" + value = "10" } } } @@ -71,13 +71,13 @@ resource "google_sql_database_instance" "postgres_mcp_modify" { # [START cloud_sql_postgres_instance_mcp_disable] resource "google_sql_database_instance" "postgres_mcp_disable" { - name = "postgres-instance-mcp-disable" - region = "us-central1" - database_version = "POSTGRES_16" + name = "postgres-instance-mcp-disable" + region = "us-central1" + database_version = "POSTGRES_16" deletion_protection = false settings { - tier = "db-perf-optimized-N-2" + tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { # Set to false to disable MCP. You can also remove the block entirely. From 8ba52ce48f2ed8680cf97fa13da1b5b8d0c02f0d Mon Sep 17 00:00:00 2001 From: xuebaoZ Date: Wed, 18 Jun 2025 21:11:21 +0000 Subject: [PATCH 4/5] avoid using the MCP acronym --- .../main.tf | 41 ++++++++++--------- .../test.yaml | 2 +- .../main.tf | 34 +++++++-------- .../test.yaml | 2 +- 4 files changed, 40 insertions(+), 39 deletions(-) rename cloud_sql/{mysql_instance_mcp => mysql_instance_managed_connection_pooling}/main.tf (52%) rename cloud_sql/{mysql_instance_mcp => mysql_instance_managed_connection_pooling}/test.yaml (92%) rename cloud_sql/{postgres_instance_mcp => postgres_instance_managed_connection_pooling}/main.tf (57%) rename cloud_sql/{postgres_instance_mcp => postgres_instance_managed_connection_pooling}/test.yaml (92%) diff --git a/cloud_sql/mysql_instance_mcp/main.tf b/cloud_sql/mysql_instance_managed_connection_pooling/main.tf similarity index 52% rename from cloud_sql/mysql_instance_mcp/main.tf rename to cloud_sql/mysql_instance_managed_connection_pooling/main.tf index b3bbf8b1..7bba22b5 100644 --- a/cloud_sql/mysql_instance_mcp/main.tf +++ b/cloud_sql/mysql_instance_managed_connection_pooling/main.tf @@ -14,9 +14,10 @@ * limitations under the License. */ -# [START cloud_sql_mysql_instance_mcp_creation] -resource "google_sql_database_instance" "mysql_mcp_creation" { - name = "mysql-instance-mcp-creation" +# [START cloud_sql_mysql_instance_managed_connection_pooling_creation] +# This example shows creating an instance with Managed Connection Pooling. +resource "google_sql_database_instance" "mysql_managed_connection_pooling_creation" { + name = "mysql-instance-managed-connection-pooling-creation" region = "us-central1" database_version = "MYSQL_8_0" deletion_protection = false @@ -29,12 +30,12 @@ resource "google_sql_database_instance" "mysql_mcp_creation" { } } } -# [END cloud_sql_mysql_instance_mcp_creation] +# [END cloud_sql_mysql_instance_managed_connection_pooling_creation] -# [START cloud_sql_mysql_instance_mcp_enable] -# This example shows creating an instance with MCP enabled and custom flags set. -resource "google_sql_database_instance" "mysql_mcp_enable" { - name = "mysql-instance-mcp-enable" +# [START cloud_sql_mysql_instance_managed_connection_pooling_enable] +# This example shows creating an instance with Managed Connection Pooling enabled and custom flags set. +resource "google_sql_database_instance" "mysql_managed_connection_pooling_enable" { + name = "mysql-instance-managed-connection-pooling-enable" region = "us-central1" database_version = "MYSQL_8_0" deletion_protection = false @@ -47,12 +48,12 @@ resource "google_sql_database_instance" "mysql_mcp_enable" { } } } -# [END cloud_sql_mysql_instance_mcp_enable] +# [END cloud_sql_mysql_instance_managed_connection_pooling_enable] -# [START cloud_sql_mysql_instance_mcp_modify] -# This example shows modifying the flags of an existing MCP configuration. -resource "google_sql_database_instance" "mysql_mcp_modify" { - name = "mysql-instance-mcp-modify" +# [START cloud_sql_mysql_instance_managed_connection_pooling_modify] +# This example shows modifying the flags of an existing Managed Connection Pooling configuration. +resource "google_sql_database_instance" "mysql_managed_connection_pooling_modify" { + name = "mysql-instance-managed-connection-pooling-modify" region = "us-central1" database_version = "MYSQL_8_0" deletion_protection = false @@ -69,12 +70,12 @@ resource "google_sql_database_instance" "mysql_mcp_modify" { } } } -# [END cloud_sql_mysql_instance_mcp_modify] +# [END cloud_sql_mysql_instance_managed_connection_pooing_modify] -# [START cloud_sql_mysql_instance_mcp_disable] -# This example shows disabling MCP on an existing instance. -resource "google_sql_database_instance" "mysql_mcp_disable" { - name = "mysql-instance-mcp-disable" +# [START cloud_sql_mysql_instance_managed_connection_pooling_disable] +# This example shows disabling Managed Connection Pooling on an existing instance. +resource "google_sql_database_instance" "mysql_managed_connection_pooling_disable" { + name = "mysql-instance-managed-connection-pooling-disable" region = "us-central1" database_version = "MYSQL_8_0" deletion_protection = false @@ -83,9 +84,9 @@ resource "google_sql_database_instance" "mysql_mcp_disable" { tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { - # Set to false to disable MCP. You can also remove the block entirely. + # Set to false to disable Managed Connection Pooling. You can also remove the block entirely. connection_pooling_enabled = false } } } -# [END cloud_sql_mysql_instance_mcp_disable] +# [END cloud_sql_mysql_instance_managed_connection_pooling_disable] diff --git a/cloud_sql/mysql_instance_mcp/test.yaml b/cloud_sql/mysql_instance_managed_connection_pooling/test.yaml similarity index 92% rename from cloud_sql/mysql_instance_mcp/test.yaml rename to cloud_sql/mysql_instance_managed_connection_pooling/test.yaml index 17ef0c92..1446df04 100644 --- a/cloud_sql/mysql_instance_mcp/test.yaml +++ b/cloud_sql/mysql_instance_managed_connection_pooling/test.yaml @@ -15,6 +15,6 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintTest metadata: - name: sql_mysql_instance_mcp + name: sql_mysql_instance_managed_connection_pooling spec: skip: true diff --git a/cloud_sql/postgres_instance_mcp/main.tf b/cloud_sql/postgres_instance_managed_connection_pooling/main.tf similarity index 57% rename from cloud_sql/postgres_instance_mcp/main.tf rename to cloud_sql/postgres_instance_managed_connection_pooling/main.tf index 7475f958..1c6beaff 100644 --- a/cloud_sql/postgres_instance_mcp/main.tf +++ b/cloud_sql/postgres_instance_managed_connection_pooling/main.tf @@ -14,9 +14,9 @@ * limitations under the License. */ -# [START cloud_sql_postgres_instance_mcp_creation] -resource "google_sql_database_instance" "postgres_mcp_creation" { - name = "postgres-instance-mcp-creation" +# [START cloud_sql_postgres_instance_managed_connection_pooling_creation] +resource "google_sql_database_instance" "postgres_managed_connection_pooling_creation" { + name = "postgres-instance-managed-connection-pooling-creation" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false @@ -29,11 +29,11 @@ resource "google_sql_database_instance" "postgres_mcp_creation" { } } } -# [END cloud_sql_postgres_instance_mcp_creation] +# [END cloud_sql_postgres_instance_managed_connection_pooling_creation] -# [START cloud_sql_postgres_instance_mcp_enable] -resource "google_sql_database_instance" "postgres_mcp_enable" { - name = "postgres-instance-mcp-enable" +# [START cloud_sql_postgres_instance_managed_connection_pooling_enable] +resource "google_sql_database_instance" "postgres_managed_connection_pooling_enable" { + name = "postgres-instance-managed-connection-pooling-enable" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false @@ -46,11 +46,11 @@ resource "google_sql_database_instance" "postgres_mcp_enable" { } } } -# [END cloud_sql_postgres_instance_mcp_enable] +# [END cloud_sql_postgres_instance_managed_connection_pooling_enable] -# [START cloud_sql_postgres_instance_mcp_modify] -resource "google_sql_database_instance" "postgres_mcp_modify" { - name = "postgres-instance-mcp-modify" +# [START cloud_sql_postgres_instance_managed_connection_pooling_modify] +resource "google_sql_database_instance" "postgres_managed_connection_pooling_modify" { + name = "postgres-instance-managed-connection-pooling-modify" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false @@ -67,11 +67,11 @@ resource "google_sql_database_instance" "postgres_mcp_modify" { } } } -# [END cloud_sql_postgres_instance_mcp_modify] +# [END cloud_sql_postgres_instance_managed_connection_pooling_modify] -# [START cloud_sql_postgres_instance_mcp_disable] -resource "google_sql_database_instance" "postgres_mcp_disable" { - name = "postgres-instance-mcp-disable" +# [START cloud_sql_postgres_instance_managed_connection_pooling_disable] +resource "google_sql_database_instance" "postgres_managed_connection_pooling_disable" { + name = "postgres-instance-managed-connection-pooling-disable" region = "us-central1" database_version = "POSTGRES_16" deletion_protection = false @@ -80,9 +80,9 @@ resource "google_sql_database_instance" "postgres_mcp_disable" { tier = "db-perf-optimized-N-2" edition = "ENTERPRISE_PLUS" connection_pool_config { - # Set to false to disable MCP. You can also remove the block entirely. + # Set to false to disable Managed Connection Pooling. You can also remove the block entirely. connection_pooling_enabled = false } } } -# [END cloud_sql_postgres_instance_mcp_disable] +# [END cloud_sql_postgres_instance_managed_connection_pooling_disable] diff --git a/cloud_sql/postgres_instance_mcp/test.yaml b/cloud_sql/postgres_instance_managed_connection_pooling/test.yaml similarity index 92% rename from cloud_sql/postgres_instance_mcp/test.yaml rename to cloud_sql/postgres_instance_managed_connection_pooling/test.yaml index 512e4d7d..b54d3d56 100644 --- a/cloud_sql/postgres_instance_mcp/test.yaml +++ b/cloud_sql/postgres_instance_managed_connection_pooling/test.yaml @@ -15,6 +15,6 @@ apiVersion: blueprints.cloud.google.com/v1alpha1 kind: BlueprintTest metadata: - name: sql_postgres_instance_mcp + name: sql_postgres_instance_managed_connection_pooling spec: skip: true From 0bef09266052196d57f01dfa3f8a317593eb7d3b Mon Sep 17 00:00:00 2001 From: xuebaoZ Date: Wed, 18 Jun 2025 21:11:21 +0000 Subject: [PATCH 5/5] avoid using the MCP acronym --- cloud_sql/mysql_instance_managed_connection_pooling/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud_sql/mysql_instance_managed_connection_pooling/main.tf b/cloud_sql/mysql_instance_managed_connection_pooling/main.tf index 7bba22b5..b063450d 100644 --- a/cloud_sql/mysql_instance_managed_connection_pooling/main.tf +++ b/cloud_sql/mysql_instance_managed_connection_pooling/main.tf @@ -70,7 +70,7 @@ resource "google_sql_database_instance" "mysql_managed_connection_pooling_modify } } } -# [END cloud_sql_mysql_instance_managed_connection_pooing_modify] +# [END cloud_sql_mysql_instance_managed_connection_pooling_modify] # [START cloud_sql_mysql_instance_managed_connection_pooling_disable] # This example shows disabling Managed Connection Pooling on an existing instance.