Skip to content

Commit f42886b

Browse files
authored
Merge pull request #33 from Datatamer/zonal
MINOR: add support for zonal instances SRE-3001
2 parents 8b2fed7 + cdaca00 commit f42886b

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This modules creates the following resources:
3838
| backup\_enabled | True if backup configuration is enabled. | `bool` | `true` | no |
3939
| backup\_point\_in\_time\_recovery\_enabled | True if Point-in-time recovery is enabled. Will restart database if enabled after instance creation. | `bool` | `true` | no |
4040
| backup\_start\_time | HH:MM format time indicating when backup configuration starts. | `string` | `"06:00"` | no |
41+
| cloudsql\_availability\_type | The availability type of the Cloud SQL instance, high availability (REGIONAL) or single zone (ZONAL). | `string` | `"REGIONAL"` | no |
4142
| database\_flags | List of Cloud SQL flags that are applied to the database server. See [more details](https://cloud.google.com/sql/docs/mysql/flags) | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
4243
| db\_name | name of the database | `string` | `"doit"` | no |
4344
| deletion\_protection | Set deletion protection on Cloud SQL instance. Unless this field is set to false, a terraform destroy or terraform apply command that deletes the instance will fail. | `bool` | `true` | no |

examples/minimal/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ No provider.
99

1010
## Inputs
1111

12-
No input.
12+
| Name | Description | Type | Default | Required |
13+
|------|-------------|------|---------|:--------:|
14+
| name | n/a | `string` | n/a | yes |
15+
| project\_id | n/a | `string` | n/a | yes |
1316

1417
## Outputs
1518

examples/minimal/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "minimal" {
22
source = "../../"
33

4-
name = var.name
4+
name = var.name
55
project_id = var.project_id
66
}

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ resource "google_sql_database_instance" "tamr" {
2121
activation_policy = var.activation_policy
2222
disk_autoresize = var.disk_autoresize
2323
user_labels = var.labels
24-
availability_type = "REGIONAL"
24+
availability_type = var.cloudsql_availability_type
2525

2626
dynamic "backup_configuration" {
2727
for_each = var.backup_enabled ? ["true"] : []

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,9 @@ variable "deletion_protection" {
100100
description = "Set deletion protection on Cloud SQL instance. Unless this field is set to false, a terraform destroy or terraform apply command that deletes the instance will fail."
101101
default = true
102102
}
103+
104+
variable "cloudsql_availability_type" {
105+
type = string
106+
description = "The availability type of the Cloud SQL instance, high availability (REGIONAL) or single zone (ZONAL)."
107+
default = "REGIONAL"
108+
}

0 commit comments

Comments
 (0)