https://github.com/data-platform-hq/terraform-google-cloud-sql
Terraform module for managing Google Cloud SQL
https://github.com/data-platform-hq/terraform-google-cloud-sql
cloud-sql google-cloud terraform-module
Last synced: 3 months ago
JSON representation
Terraform module for managing Google Cloud SQL
- Host: GitHub
- URL: https://github.com/data-platform-hq/terraform-google-cloud-sql
- Owner: data-platform-hq
- License: apache-2.0
- Created: 2022-11-14T10:12:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-26T10:56:54.000Z (almost 3 years ago)
- Last Synced: 2025-02-24T23:34:55.969Z (11 months ago)
- Topics: cloud-sql, google-cloud, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/data-platform-hq/cloud-sql/google/latest
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Cloud SQL Terraform module
Terraform module for creation Google Cloud SQL resources
## Usage
## Requirements
| Name | Version |
| ------------------------------------------------------------------------- | -------- |
| [terraform](#requirement\_terraform) | >= 1.0.0 |
| [google](#requirement\_google) | = 4.24.0 |
| [random](#requirement\_random) | = 3.4.3 |
## Providers
| Name | Version |
| ---------------------------------------------------------- | ------- |
| [google](#provider\_google) | 4.24.0 |
| [random](#provider\_random) | 3.4.3 |
## Modules
No modules.
## Resources
| Name | Type |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| [google_sql_user.users](https://registry.terraform.io/providers/hashicorp/google/4.24.0/docs/resources/sql_user) | resource |
| [google_compute_global_address.private_ip_address](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_global_address) | resource |
| [google_service_networking_connection.private_vpc_connection](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_networking_connection) | resource |
| [google_sql_database_instance.sql_instance](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance) | resource |
| [google_project_iam_member.sql](https://registry.terraform.io/providers/hashicorp/google/4.24.0/docs/resources/google_project_iam) | resource |
| [random_string.sqluser_passwd](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
| [random_id.db_name_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
## Inputs
| Name | Description | Type | Default | Required |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ---------------------------------- | :------: |
| [project\_id](#input\_project\_id) | ID of the project in which the resources should be created. | `string` | n/a | yes |
| [region](#input\_region) | The location or cloud resources region for the environment. | `string` | n/a | yes |
| [product\_base\_name](#input\_product\_base\_name) | Cloud resources base name (used to create services). | `string` | n/a | yes |
| [env](#input\_env) | Variable to mark the environment of the resource (used to create services). | `string` | n/a | yes |
| [users](#input\_users) | Names of SQL instance users. | `map(string)` | {} | no |
| [network](#input\_network) | The VPC network from which the Cloud SQL instance is accessible for private IP. | `string` | n/a | yes |
| [purpose](#input\_purpose) | The purpose of the resource. VPC_PEERING or PRIVATE_SERVICE_CONNECT. | `string` | "VPC_PEERING" | no |
| [address\_type](#input\_address\_type) | The type of the address to reserve. EXTERNAL or INTERNAL. | `string` | "INTERNAL" | no |
| [prefix\_length](#input\_prefix\_length) | The prefix length of the IP range. For more see google_compute_global_address resource description. | `number` | "24" | no |
| [service](#input\_service) | Provider peering service that is managing peering connectivity for a service provider organization. | `string` | "servicenetworking.googleapis.com" | no |
| [db\_version](#input\_db\_version) | The MySQL, PostgreSQL or SQL Server version to use (see the description of the google_sql_database_instance resource). | `string` | "SQLSERVER_2019_EXPRESS" | no |
| [tier](#input\_tier) | The machine type to use. | `string` | n/a | yes |
| [public\_ip](#input\_public\_ip) | Whether this Cloud SQL instance should be assigned a public IPV4 address. At least public_ip must be enabled or a private_network must be configured. | `bool` | false | no |
| [require\_ssl](#input\_require\_ssl) | Whether SSL connections over IP are enforced or not. | `bool` | true | no |
| [database\_flags](#input\_database\_flags) | Cloud SQL instance settings flags. | `map(string)` | {} | no |
| [deletion\_protection](#input\_deletion\_protection) | Whether or not to allow Terraform to destroy the instance. To protect SQL instence set true. | `bool` | false | no |
| [sqlsa\_roles](#input\_sqlsa\_roles) | The role that should be applied for SQL service account. | `set(string)` | [] | no |
| [labels](#input\_labels) | A set of key/value user label pairs to assign to the instance. | `map(string)` | {} | no |
## Outputs
| Name | Description |
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [sql\_instance\_ip](#output\_sql\_instance\_ip) | The first private IPv4 address assigned to sql instance. |
| [sql\_instance\_name](#output\_sql\_instance\_name) | The sql instance name. |
| [sql\_service\_acc](#output\_dp\_serverless\_secret) | The service account email address assigned to the sql instance. |
| [users\_creds](#output\_users\_creds) | Passwords for provided users. |
## License
Apache 2 Licensed. For more information please see [LICENSE](https://github.com/data-platform-hq/terraform-google-cloud-sql/blob/main/LICENSE)