Skip to content

Commit bd18567

Browse files
committed
feat(cloud_sql): add MCP instances examples
1 parent f671620 commit bd18567

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

.terraform.lock

Whitespace-only changes.

cloud_sql/mysql_instance_mcp/main.tf

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ resource "google_sql_database_instance" "mysql_mcp_creation" {
1919
name = "mysql-instance-mcp-creation"
2020
region = "us-central1"
2121
database_version = "MYSQL_8_0"
22+
deletion_protection = false
2223

2324
settings {
24-
tier = "db-perf-optimized-N-2"
25+
tier = "db-perf-optimized-N-2"
26+
edition = "ENTERPRISE_PLUS"
2527
connection_pool_config {
2628
connection_pooling_enabled = true
2729
}
@@ -35,9 +37,11 @@ resource "google_sql_database_instance" "mysql_mcp_enable" {
3537
name = "mysql-instance-mcp-enable"
3638
region = "us-central1"
3739
database_version = "MYSQL_8_0"
40+
deletion_protection = false
3841

3942
settings {
40-
tier = "db-perf-optimized-N-2"
43+
tier = "db-perf-optimized-N-2"
44+
edition = "ENTERPRISE_PLUS"
4145
connection_pool_config {
4246
connection_pooling_enabled = true
4347
}
@@ -51,14 +55,16 @@ resource "google_sql_database_instance" "mysql_mcp_modify" {
5155
name = "mysql-instance-mcp-modify"
5256
region = "us-central1"
5357
database_version = "MYSQL_8_0"
58+
deletion_protection = false
5459

5560
settings {
56-
tier = "db-perf-optimized-N-2"
61+
tier = "db-perf-optimized-N-2"
62+
edition = "ENTERPRISE_PLUS"
5763
connection_pool_config {
5864
connection_pooling_enabled = true
5965
flags {
60-
name = "max_client_connections" # Modify or add the value of an flag
61-
value = "1980"
66+
name = "max_pool_size" # Modify or add the name and value of an flag
67+
value = "10"
6268
}
6369
}
6470
}
@@ -71,19 +77,15 @@ resource "google_sql_database_instance" "mysql_mcp_disable" {
7177
name = "mysql-instance-mcp-disable"
7278
region = "us-central1"
7379
database_version = "MYSQL_8_0"
80+
deletion_protection = false
7481

7582
settings {
76-
tier = "db-perf-optimized-N-2"
83+
tier = "db-perf-optimized-N-2"
84+
edition = "ENTERPRISE_PLUS"
7785
connection_pool_config {
7886
# Set to false to disable MCP. You can also remove the block entirely.
7987
connection_pooling_enabled = false
8088
}
8189
}
8290
}
8391
# [END cloud_sql_mysql_instance_mcp_disable]
84-
85-
# [START cloud_sql_mysql_instance_mcp_view]
86-
# To view the current status, you can use the `terraform show` command after applying
87-
# your configuration. The `connection_pool_config` block will reflect the current state.
88-
terraform show
89-
# [END cloud_sql_mysql_instance_mcp_view]

cloud_sql/postgres_instance_mcp/main.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ resource "google_sql_database_instance" "postgres_mcp_creation" {
1919
name = "postgres-instance-mcp-creation"
2020
region = "us-central1"
2121
database_version = "POSTGRES_16"
22+
deletion_protection = false
2223

2324
settings {
2425
tier = "db-perf-optimized-N-2"
26+
edition = "ENTERPRISE_PLUS"
2527
connection_pool_config {
2628
connection_pooling_enabled = true
2729
}
@@ -34,9 +36,11 @@ resource "google_sql_database_instance" "postgres_mcp_enable" {
3436
name = "postgres-instance-mcp-enable"
3537
region = "us-central1"
3638
database_version = "POSTGRES_16"
39+
deletion_protection = false
3740

3841
settings {
3942
tier = "db-perf-optimized-N-2"
43+
edition = "ENTERPRISE_PLUS"
4044
connection_pool_config {
4145
connection_pooling_enabled = true # Set to true here
4246
}
@@ -49,13 +53,15 @@ resource "google_sql_database_instance" "postgres_mcp_modify" {
4953
name = "postgres-instance-mcp-modify"
5054
region = "us-central1"
5155
database_version = "POSTGRES_16"
56+
deletion_protection = false
5257

5358
settings {
5459
tier = "db-perf-optimized-N-2"
60+
edition = "ENTERPRISE_PLUS"
5561
connection_pool_config {
5662
connection_pooling_enabled = true
5763
flags {
58-
name = "max_client_connections" # Modify the value of an existing flag
64+
name = "max_pool_size" # Modify the value of an existing flag
5965
value = "2000"
6066
}
6167
}
@@ -68,19 +74,15 @@ resource "google_sql_database_instance" "postgres_mcp_disable" {
6874
name = "postgres-instance-mcp-disable"
6975
region = "us-central1"
7076
database_version = "POSTGRES_16"
77+
deletion_protection = false
7178

7279
settings {
7380
tier = "db-perf-optimized-N-2"
81+
edition = "ENTERPRISE_PLUS"
7482
connection_pool_config {
7583
# Set to false to disable MCP. You can also remove the block entirely.
7684
connection_pooling_enabled = false
7785
}
7886
}
7987
}
8088
# [END cloud_sql_postgres_instance_mcp_disable]
81-
82-
# [START cloud_sql_postgres_instance_mcp_view]
83-
# To view the current status, you can use the `terraform show` command after applying
84-
# your configuration. The `connection_pool_config` block will reflect the current state.
85-
terraform show
86-
# [END cloud_sql_postgres_instance_mcp_view]

0 commit comments

Comments
 (0)