Terrafom module to deploy a MySQL Server on Google Cloud.
- Support standalone(one read-write instance) and replication(one read-write instance and multiple read-only instances, for read write splitting).
module "mysql" {
source = "..."
infrastructure = {
vpc_id = "..."
}
}
Please read our contributing guide if you're interested in contributing to Walrus template.
Name | Version |
---|---|
terraform | >= 1.0 |
>= 3.5.0 | |
random | >= 3.5.1 |
Name | Version |
---|---|
>= 3.5.0 | |
random | >= 3.5.1 |
No modules.
Name | Type |
---|---|
google_compute_global_address.default | resource |
google_compute_network.default | resource |
google_service_networking_connection.default | resource |
google_sql_database.database | resource |
google_sql_database_instance.primary | resource |
google_sql_database_instance.secondary | resource |
google_sql_user.users | resource |
random_password.password | resource |
random_string.name_suffix | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
architecture | Specify the deployment architecture, select from standalone or replication. | string |
"standalone" |
no |
context | Receive contextual information. When Walrus deploys, Walrus will inject specific contextual information into this field. Examples: context: |
map(any) |
{} |
no |
database | Specify the database name. The database name must be 1-60 characters long and start with any lower letter, combined with number, or symbols: - _. The database name cannot be MySQL forbidden keyword. |
string |
"mydb" |
no |
engine_version | Specify the deployment engine version, select from https://cloud.google.com/sql/docs/db-versions. | string |
"8.0" |
no |
infrastructure | Specify the infrastructure information for deploying. Examples: infrastructure: |
object({ |
{} |
no |
password | Specify the account password. The password must be 8-128 characters long and start with any letter, number, or symbols: ! # $ % ^ & * ( ) _ + - =. If not specified, it will generate a random password. |
string |
null |
no |
replication_readonly_replicas | Specify the number of read-only replicas under the replication deployment. | number |
1 |
no |
resources | Specify the computing resources. The computing resource design of Google Cloud is very complex, it also needs to consider on the storage resource, please view the specification document for more information. Examples: resources: |
object({ |
{ |
no |
storage | Specify the storage resources, select from PD_SSD or PD_HDD. Choosing the storage resource is also related to the computing resource, please view the specification document for more information. Examples: storage: |
object({ |
{ |
no |
username | Specify the account username. The username must be 1-32 characters long and start with lower letter, combined with number. The username cannot be MySQL forbidden keyword. |
string |
"rdsuser" |
no |
Name | Description |
---|---|
address | The address, a string only has host, might be a comma separated string or a single string. |
address_readonly | The readonly address, a string only has host, might be a comma separated string or a single string. |
connection | The connection, a string combined host and port, might be a comma separated string or a single string. |
connection_readonly | The readonly connection, a string combined host and port, might be a comma separated string or a single string. |
context | The input context, a map, which is used for orchestration. |
database | The name of MySQL database to access. |
password | The password of the account to access the database. |
port | The port of the service. |
refer | The refer, a map, including hosts, ports and account, which is used for dependencies or collaborations. |
username | The username of the account to access the database. |