Skip to content

Latest commit

 

History

History
96 lines (74 loc) · 5.4 KB

File metadata and controls

96 lines (74 loc) · 5.4 KB

Description

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.

Example

- 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.

License

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.

Requirements

Name Version
terraform >= 0.13.0
google >= 3.83
random ~> 3.0

Providers

Name Version
google >= 3.83
random ~> 3.0

Modules

No modules.

Resources

Name Type
google_bigquery_connection.connection 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

Inputs

Name Description Type Default Required
authorized_networks IP address ranges as authorized networks of the Cloud SQL for MySQL instances list(string) [] 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
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
tier The machine type to use for the SQL instance string n/a yes
user_managed_replication Replication parameters that will be used for defined secrets
list(object({
location = string
kms_key_name = optional(string)
}))
[] no

Outputs

Name Description
cloudsql Describes the cloudsql instance.