/!\ This module is not production ready, and only a showcase for terraform
A simple terraform module to deploy a Cloud SQL PostgreSQL instance on GCP.
GCP services used are:
- Cloud SQL
This repository tries to follow the best practices defined by Google.
This repository uses pre-commit hooks.
- Enable the tfsec hook and add the checkov hook
- Support user auth using IAM
- Store generated passwords in secret manager
- If possible do not store passwords in the state: follow this issue
- Support backups, replicas, TLS, private network, reserved public IP
Name | Version |
---|---|
terraform | >= 1.2.6 |
4.31.0 |
Name | Version |
---|---|
4.31.0 | |
random | 3.3.2 |
No modules.
Name | Type |
---|---|
google_sql_database.instance_databases | resource |
google_sql_database_instance.this | resource |
google_sql_user.instance_users | resource |
random_password.user_passwords | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
gcp_project | The GCP project id in which the Cloud SQL instance will be deployed | string |
"" |
no |
gcp_region | The GCP region in which the Cloud SQL instance will be deployed | string |
"" |
no |
instance_databases | A list of database to create. WARNING: user permissions are not managed. | list(string) |
[] |
no |
instance_name | The name of the Cloud SQL instance | string |
n/a | yes |
instance_tier | The Cloud SQL instance tier to configure the underlying VM resources | string |
"db-f1-micro" |
no |
instance_users | A list of users to create. Password are generated by Terraform. WARNING: user permissions are not managed. | list(string) |
[] |
no |
instance_version | The Cloud SQL version string for the instance | string |
"POSTGRES_14" |
no |
Name | Description |
---|---|
instance_public_ip_address | The first public (PRIMARY) IPv4 address assigned to the Cloud SQL instance |