-
Notifications
You must be signed in to change notification settings - Fork 286
feat(cloud_sql): add MySQL and PG samples for Read Pool #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
glasnt
merged 17 commits into
terraform-google-modules:main
from
psung:read-pool-samples
Aug 14, 2025
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f478963
Create test.yaml
rebecca-pete 4520482
Create main.tf
rebecca-pete 8af09f9
Create test.yaml
rebecca-pete e521bc6
Create main.tf
rebecca-pete 5d5e5b2
Delete cloud_sql/mysql_instance_replica_pool/test.yaml
rebecca-pete 63c84bc
Delete mysql_instance_replica_pool/main.tf
rebecca-pete 1a88dd4
Create main.tf
rebecca-pete ffc9843
Create test.yaml
rebecca-pete 0c503a0
MySQL and PG samples for Cloud SQL Read Pool
psung 229e255
Retain only the creation sample
psung 45aee8c
Move samples to cloud_sql subdir
psung 6078992
Remove 'create' from names as it's implied
psung 0803647
terraform fmt
psung e2c6cef
Merge branch 'main' into read-pool-samples
glasnt b9f46e0
remove CI aroundarounds, update metadata name
glasnt 1ff476b
Update database versions to latest
glasnt d244fbc
Merge branch 'main' into read-pool-samples
glasnt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /** | ||
| * 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_read_pool] | ||
|
|
||
| resource "google_sql_database_instance" "primary" { | ||
| name = "mysql-primary" | ||
| database_version = "MYSQL_8_0" | ||
| region = "europe-west4" | ||
|
|
||
| instance_type = "CLOUD_SQL_INSTANCE" | ||
|
|
||
| # If you wish to, set deletion_protection to true to prevent | ||
| # accidental deletion of this instance as a result of removing the | ||
| # Terraform resource. | ||
| deletion_protection = false | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| settings { | ||
| tier = "db-perf-optimized-N-2" | ||
| edition = "ENTERPRISE_PLUS" | ||
|
|
||
| backup_configuration { | ||
| enabled = true | ||
| binary_log_enabled = true | ||
| } | ||
|
|
||
| ip_configuration { | ||
| ipv4_enabled = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource "google_sql_database_instance" "replica" { | ||
| name = "mysql-replica" | ||
| database_version = "MYSQL_8_0" | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| region = "europe-west4" | ||
|
|
||
| master_instance_name = google_sql_database_instance.primary.name | ||
| instance_type = "READ_POOL_INSTANCE" | ||
| node_count = 2 | ||
|
|
||
| # If you wish to, set deletion_protection to true to prevent | ||
| # accidental deletion of this instance as a result of removing the | ||
| # Terraform resource. | ||
| deletion_protection = false | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| settings { | ||
| tier = "db-perf-optimized-N-2" | ||
| edition = "ENTERPRISE_PLUS" | ||
|
|
||
| ip_configuration { | ||
| ipv4_enabled = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # [END cloud_sql_mysql_read_pool] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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_read_pool | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| spec: | ||
| skip: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /** | ||
| * 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_read_pool] | ||
|
|
||
| resource "google_sql_database_instance" "primary" { | ||
| name = "postgres-primary" | ||
| database_version = "POSTGRES_15" | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| region = "europe-west4" | ||
|
|
||
| instance_type = "CLOUD_SQL_INSTANCE" | ||
|
|
||
| # If you wish to, set deletion_protection to true to prevent | ||
| # accidental deletion of this instance as a result of removing the | ||
| # Terraform resource. | ||
| deletion_protection = false | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| settings { | ||
| tier = "db-perf-optimized-N-2" | ||
| edition = "ENTERPRISE_PLUS" | ||
|
|
||
| backup_configuration { | ||
| enabled = true | ||
| } | ||
|
|
||
| ip_configuration { | ||
| ipv4_enabled = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource "google_sql_database_instance" "replica" { | ||
| name = "postgres-replica" | ||
| database_version = "POSTGRES_15" | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| region = "europe-west4" | ||
|
|
||
| master_instance_name = google_sql_database_instance.primary.name | ||
| instance_type = "READ_POOL_INSTANCE" | ||
| node_count = 2 | ||
|
|
||
| # If you wish to, set deletion_protection to true to prevent | ||
| # accidental deletion of this instance as a result of removing the | ||
| # Terraform resource. | ||
| deletion_protection = false | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| settings { | ||
| tier = "db-perf-optimized-N-2" | ||
| edition = "ENTERPRISE_PLUS" | ||
|
|
||
| ip_configuration { | ||
| ipv4_enabled = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # [END cloud_sql_postgres_read_pool] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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_read_pool | ||
glasnt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| spec: | ||
| skip: true | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.