terraform-google-sql makes it easy to create a Google CloudSQL instance and implement high availability settings. This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
The cloudsql created here is used to integrate with the slurm cluster to enable accounting data storage.
- id: project
source: community/modules/database/cloudsql-federation
use: [network1]
settings:
sql_instance_name: slurm-sql6-demo
tier: "db-f1-micro"
This creates a cloud sql instance, including a database, user that would allow the slurm cluster to use as an external DB. In addition, it will allow BigQuery to run federated query through it.
Copyright 2022 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.
Name | Version |
---|---|
terraform | >= 0.13.0 |
>= 3.83 | |
random | ~> 3.0 |
Name | Version |
---|---|
>= 3.83 | |
random | ~> 3.0 |
No modules.
Name | Type |
---|---|
google_bigquery_connection.connection | resource |
google_compute_address.psc | resource |
google_compute_forwarding_rule.psc_consumer | resource |
google_sql_database.database | resource |
google_sql_database_instance.instance | resource |
google_sql_user.users | resource |
random_id.resource_name_suffix | resource |
random_password.password | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
authorized_networks | IP address ranges as authorized networks of the Cloud SQL for MySQL instances | list(string) |
[] |
no |
data_cache_enabled | Whether data cache is enabled for the instance. Can be used with ENTERPRISE_PLUS edition. | bool |
false |
no |
database_version | The version of the database to be created. | string |
"MYSQL_5_7" |
no |
deletion_protection | Whether or not to allow Terraform to destroy the instance. | string |
false |
no |
deployment_name | The name of the current deployment | string |
n/a | yes |
disk_autoresize | Set to false to disable automatic disk grow. | bool |
true |
no |
disk_size_gb | Size of the database disk in GiB. | number |
null |
no |
edition | value | string |
"ENTERPRISE" |
no |
enable_backups | Set true to enable backups | bool |
false |
no |
labels | Labels to add to the instances. Key-value pairs. | map(string) |
n/a | yes |
network_id | The ID of the GCE VPC network to which the instance is going to be created in.:projects/<project_id>/global/networks/<network_name> " |
string |
n/a | yes |
private_vpc_connection_peering | The name of the VPC Network peering connection, used only as dependency for Cloud SQL creation. | string |
null |
no |
project_id | Project in which the HPC deployment will be created | string |
n/a | yes |
region | The region where SQL instance will be configured | string |
n/a | yes |
sql_instance_name | name given to the sql instance for ease of identificaion | string |
n/a | yes |
sql_password | Password for the SQL database. | any |
null |
no |
sql_username | Username for the SQL database | string |
"slurm" |
no |
subnetwork_self_link | Self link of the network where Cloud SQL instance PSC endpoint will be created | string |
null |
no |
tier | The machine type to use for the SQL instance | string |
n/a | yes |
use_psc_connection | Create Private Service Connection instead of using Private Service Access peering | bool |
false |
no |
user_managed_replication | Replication parameters that will be used for defined secrets | list(object({ |
[] |
no |
Name | Description |
---|---|
cloudsql | Describes the cloudsql instance. |