Skip to content

Commit 7a8c4e2

Browse files
authored
Merge branch 'main' into sample_lifecycle_storage
2 parents 37fa1e1 + db45bfa commit 7a8c4e2

File tree

5 files changed

+220
-0
lines changed

5 files changed

+220
-0
lines changed

.terraform.lock

Whitespace-only changes.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START cloud_sql_mysql_instance_managed_connection_pooling_creation]
18+
# This example shows creating an instance with Managed Connection Pooling.
19+
resource "google_sql_database_instance" "mysql_managed_connection_pooling_creation" {
20+
name = "mysql-instance-managed-connection-pooling-creation"
21+
region = "us-central1"
22+
database_version = "MYSQL_8_0"
23+
deletion_protection = false
24+
25+
settings {
26+
tier = "db-perf-optimized-N-2"
27+
edition = "ENTERPRISE_PLUS"
28+
connection_pool_config {
29+
connection_pooling_enabled = true
30+
}
31+
}
32+
}
33+
# [END cloud_sql_mysql_instance_managed_connection_pooling_creation]
34+
35+
# [START cloud_sql_mysql_instance_managed_connection_pooling_enable]
36+
# This example shows creating an instance with Managed Connection Pooling enabled and custom flags set.
37+
resource "google_sql_database_instance" "mysql_managed_connection_pooling_enable" {
38+
name = "mysql-instance-managed-connection-pooling-enable"
39+
region = "us-central1"
40+
database_version = "MYSQL_8_0"
41+
deletion_protection = false
42+
43+
settings {
44+
tier = "db-perf-optimized-N-2"
45+
edition = "ENTERPRISE_PLUS"
46+
connection_pool_config {
47+
connection_pooling_enabled = true
48+
}
49+
}
50+
}
51+
# [END cloud_sql_mysql_instance_managed_connection_pooling_enable]
52+
53+
# [START cloud_sql_mysql_instance_managed_connection_pooling_modify]
54+
# This example shows modifying the flags of an existing Managed Connection Pooling configuration.
55+
resource "google_sql_database_instance" "mysql_managed_connection_pooling_modify" {
56+
name = "mysql-instance-managed-connection-pooling-modify"
57+
region = "us-central1"
58+
database_version = "MYSQL_8_0"
59+
deletion_protection = false
60+
61+
settings {
62+
tier = "db-perf-optimized-N-2"
63+
edition = "ENTERPRISE_PLUS"
64+
connection_pool_config {
65+
connection_pooling_enabled = true
66+
flags {
67+
name = "max_pool_size" # Modify or add the name and value of an flag
68+
value = "10"
69+
}
70+
}
71+
}
72+
}
73+
# [END cloud_sql_mysql_instance_managed_connection_pooling_modify]
74+
75+
# [START cloud_sql_mysql_instance_managed_connection_pooling_disable]
76+
# This example shows disabling Managed Connection Pooling on an existing instance.
77+
resource "google_sql_database_instance" "mysql_managed_connection_pooling_disable" {
78+
name = "mysql-instance-managed-connection-pooling-disable"
79+
region = "us-central1"
80+
database_version = "MYSQL_8_0"
81+
deletion_protection = false
82+
83+
settings {
84+
tier = "db-perf-optimized-N-2"
85+
edition = "ENTERPRISE_PLUS"
86+
connection_pool_config {
87+
# Set to false to disable Managed Connection Pooling. You can also remove the block entirely.
88+
connection_pooling_enabled = false
89+
}
90+
}
91+
}
92+
# [END cloud_sql_mysql_instance_managed_connection_pooling_disable]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintTest
17+
metadata:
18+
name: sql_mysql_instance_managed_connection_pooling
19+
spec:
20+
skip: true
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START cloud_sql_postgres_instance_managed_connection_pooling_creation]
18+
resource "google_sql_database_instance" "postgres_managed_connection_pooling_creation" {
19+
name = "postgres-instance-managed-connection-pooling-creation"
20+
region = "us-central1"
21+
database_version = "POSTGRES_16"
22+
deletion_protection = false
23+
24+
settings {
25+
tier = "db-perf-optimized-N-2"
26+
edition = "ENTERPRISE_PLUS"
27+
connection_pool_config {
28+
connection_pooling_enabled = true
29+
}
30+
}
31+
}
32+
# [END cloud_sql_postgres_instance_managed_connection_pooling_creation]
33+
34+
# [START cloud_sql_postgres_instance_managed_connection_pooling_enable]
35+
resource "google_sql_database_instance" "postgres_managed_connection_pooling_enable" {
36+
name = "postgres-instance-managed-connection-pooling-enable"
37+
region = "us-central1"
38+
database_version = "POSTGRES_16"
39+
deletion_protection = false
40+
41+
settings {
42+
tier = "db-perf-optimized-N-2"
43+
edition = "ENTERPRISE_PLUS"
44+
connection_pool_config {
45+
connection_pooling_enabled = true # Set to true here
46+
}
47+
}
48+
}
49+
# [END cloud_sql_postgres_instance_managed_connection_pooling_enable]
50+
51+
# [START cloud_sql_postgres_instance_managed_connection_pooling_modify]
52+
resource "google_sql_database_instance" "postgres_managed_connection_pooling_modify" {
53+
name = "postgres-instance-managed-connection-pooling-modify"
54+
region = "us-central1"
55+
database_version = "POSTGRES_16"
56+
deletion_protection = false
57+
58+
settings {
59+
tier = "db-perf-optimized-N-2"
60+
edition = "ENTERPRISE_PLUS"
61+
connection_pool_config {
62+
connection_pooling_enabled = true
63+
flags {
64+
name = "max_pool_size" # Modify the value of an existing flag
65+
value = "10"
66+
}
67+
}
68+
}
69+
}
70+
# [END cloud_sql_postgres_instance_managed_connection_pooling_modify]
71+
72+
# [START cloud_sql_postgres_instance_managed_connection_pooling_disable]
73+
resource "google_sql_database_instance" "postgres_managed_connection_pooling_disable" {
74+
name = "postgres-instance-managed-connection-pooling-disable"
75+
region = "us-central1"
76+
database_version = "POSTGRES_16"
77+
deletion_protection = false
78+
79+
settings {
80+
tier = "db-perf-optimized-N-2"
81+
edition = "ENTERPRISE_PLUS"
82+
connection_pool_config {
83+
# Set to false to disable Managed Connection Pooling. You can also remove the block entirely.
84+
connection_pooling_enabled = false
85+
}
86+
}
87+
}
88+
# [END cloud_sql_postgres_instance_managed_connection_pooling_disable]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintTest
17+
metadata:
18+
name: sql_postgres_instance_managed_connection_pooling
19+
spec:
20+
skip: true

0 commit comments

Comments
 (0)