Skip to content

konpyutaika/terraform-gcp-cloud-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

Name Version
terraform >=0.15
google >= 3.89.0
random >= 3.1.0
vault >= 2.17.0

Providers

Name Version
google >= 3.89.0
google-beta n/a
random >= 3.1.0

Modules

No modules.

Resources

Name Type
google-beta_google_secret_manager_secret.registry_sql_client_cert resource
google-beta_google_secret_manager_secret.registry_sql_user_password resource
google-beta_google_secret_manager_secret_version.registry_sql_client_cert resource
google-beta_google_secret_manager_secret_version.secret-version-basic resource
google_sql_database.cloudsql_database resource
google_sql_database_instance.cloudsql_instance resource
google_sql_ssl_cert.client_cert resource
google_sql_user.cloudsql_user resource
random_password.cloudsql_user_password resource

Inputs

Name Description Type Default Required
authorized_cidrs Authorized networks CIDRs to connect to Cloud SQL instance. map(string) {} no
backup_configuration The backup_configuration subblock for the database setings
list(object({
enabled = bool
start_time = string
location = string
retained_backups = number
}))
[] no
cert_common_name Certificate Common Name. string n/a yes
database_version Database type and version. Supported values = {MYSQL_5_6, MYSQL_5_7, MYSQL_8_0, POSTGRES_9_6,POSTGRES_10, POSTGRES_11, POSTGRES_12, POSTGRES_13, ...}. See {Instance settings documentation} string n/a yes
db_name Full name of the SQL database. string n/a yes
deletion_protection If set to true, you protect an instance from being deleted. bool true no
disk_autoresize Whether if the disk can grow when more space is needed. If disk_autoresize=true do not set disk_size as terraform apply would try to set the disk_size bool true no
disk_type Type of disk used on the CloudSQL instance VM string "PD_SSD" no
instance_name Full name of the SQL instance. string n/a yes
maintenance_window Maintenance window to update/patch the VM. It can be rebooted during this maintenance window
list(object({
day = number
hour = number
update_track = string
}))
[] no
module_depends_on n/a any null no
network Self link of the VPC network string n/a yes
public_ip assign a public IP to this CloudSQL instance. Attention: you need Security approval to give a public IP to your CloudSQL instance. bool false no
region The region to host the resources in. string "europe-west1" no
require_ssl If require SSL, the connection port will be 3307, otherwise 3306. bool true no
tier CloudSQL instance machine type (service tier). See {Instance settings documentation} string n/a yes
user_host The host the user can connect from. This is only supported for MySQL instances. Don't set this field for PostgreSQL instances. Can be an IP address, or % to allow any host. Changing this forces a new resource to be created. string null no
user_name User name. string n/a yes

Outputs

Name Description
connection_name Cloud SQL connection name
database_name Cloud SQL Database name
instance_connection_name The connection name of the instance to be used in connection strings. For example, when connecting with Cloud SQL Proxy.
instance_ip_address The IPv4 address assigned to the database instance.
instance_ip_address_type The type of IP address assigned to this instance. { PRIMARY | OUTGOING | PRIVATE }. This module handles with PRIVATE only
instance_name Cloud SQL Database instance name
secret_manager_cloudsql_client_cert_secret_id Secret manager id path where the CloudSQL client certificate secret is stored
secret_manager_cloudsql_user_secret_id Secret manager id where the CloudSQL user name/password secret is stored