Skip to content

Commit

Permalink
feat(spanner): add support for defaultBackupScheduleType in spanner i…
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul2393 authored and amanMahendroo committed Dec 17, 2024
1 parent edfc70b commit 4a52803
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mmv1/products/spanner/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,13 @@ properties:
- 'STANDARD'
- 'ENTERPRISE'
- 'ENTERPRISE_PLUS'
- name: 'defaultBackupScheduleType'
type: Enum
description: |
Controls the default backup behavior for new databases within the instance.
Note that `AUTOMATIC` is not permitted for free instances, as backups and backup schedules are not allowed for free instances.
if unset or NONE, no default backup schedule will be created for new databases within the instance.
default_from_api: true
enum_values:
- 'NONE'
- 'AUTOMATIC'
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ updateMask := make([]string, 0)
if d.HasChange("edition") {
updateMask = append(updateMask, "edition")
}
if d.HasChange("default_backup_schedule_type") {
updateMask = append(updateMask, "defaultBackupScheduleType")
}
if d.HasChange("num_nodes") {
updateMask = append(updateMask, "nodeCount")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "google_spanner_instance" "example" {
display_name = "Test Spanner Instance"
num_nodes = 2
edition = "STANDARD"
default_backup_schedule_type = "AUTOMATIC"
labels = {
"foo" = "bar"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ resource "google_spanner_instance" "basic" {
display_name = "%s-dname"
num_nodes = 1
edition = "ENTERPRISE"
default_backup_schedule_type = "NONE"
}
`, name, name)
}
Expand Down Expand Up @@ -460,6 +461,7 @@ resource "google_spanner_instance" "basic" {
}
}
edition = "ENTERPRISE"
default_backup_schedule_type = "AUTOMATIC"
}
`, name, name, maxProcessingUnits, minProcessingUnits, cupUtilizationPercent, storageUtilizationPercent)
}
Expand Down

0 comments on commit 4a52803

Please sign in to comment.