Skip to content

Commit f004a52

Browse files
Adding support for week5 maintenance update track (#10732) (#18223)
[upstream:931670a86e0726fef94dac793c7e9413fda57a24] Signed-off-by: Modular Magician <[email protected]>
1 parent 1bb839b commit f004a52

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

google/services/sql/resource_sql_database_instance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ is set to true. Defaults to ZONAL.`,
549549
Type: schema.TypeString,
550550
Optional: true,
551551
AtLeastOneOf: maintenanceWindowKeys,
552-
Description: `Receive updates earlier (canary) or later (stable)`,
552+
Description: `Receive updates after one week (canary) or after two weeks (stable) or after five weeks (week5) of notification.`,
553553
},
554554
},
555555
},

google/services/sql/resource_sql_database_instance_test.go

+43
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,30 @@ func TestAccSqlDatabaseInstance_maintenance(t *testing.T) {
561561
})
562562
}
563563

564+
func TestAccSqlDatabaseInstance_maintenance_update_track_week5(t *testing.T) {
565+
t.Parallel()
566+
567+
masterID := acctest.RandInt(t)
568+
569+
acctest.VcrTest(t, resource.TestCase{
570+
PreCheck: func() { acctest.AccTestPreCheck(t) },
571+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
572+
CheckDestroy: testAccSqlDatabaseInstanceDestroyProducer(t),
573+
Steps: []resource.TestStep{
574+
{
575+
Config: fmt.Sprintf(
576+
testGoogleSqlDatabaseInstance_maintenance_week5, masterID),
577+
},
578+
{
579+
ResourceName: "google_sql_database_instance.instance",
580+
ImportState: true,
581+
ImportStateVerify: true,
582+
ImportStateVerifyIgnore: []string{"deletion_protection"},
583+
},
584+
},
585+
})
586+
}
587+
564588
func TestAccSqlDatabaseInstance_settings_upgrade(t *testing.T) {
565589
t.Parallel()
566590

@@ -3634,6 +3658,25 @@ resource "google_sql_database_instance" "instance" {
36343658
}
36353659
`
36363660

3661+
var testGoogleSqlDatabaseInstance_maintenance_week5 = `
3662+
resource "google_sql_database_instance" "instance" {
3663+
name = "tf-test-%d"
3664+
region = "us-central1"
3665+
database_version = "MYSQL_5_7"
3666+
deletion_protection = false
3667+
3668+
settings {
3669+
tier = "db-f1-micro"
3670+
3671+
maintenance_window {
3672+
day = 7
3673+
hour = 3
3674+
update_track = "week5"
3675+
}
3676+
}
3677+
}
3678+
`
3679+
36373680
var testGoogleSqlDatabaseInstance_authNets_step1 = `
36383681
resource "google_sql_database_instance" "instance" {
36393682
name = "tf-test-%d"

website/docs/r/sql_database_instance.html.markdown

+1-2
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@ when an Instance can automatically restart to apply updates. The maintenance win
419419

420420
* `hour` - (Optional) Hour of day (`0-23`), ignored if `day` not set
421421

422-
* `update_track` - (Optional) Receive updates earlier (`canary`) or later
423-
(`stable`)
422+
* `update_track` - (Optional) Receive updates after one week (`canary`) or after two weeks (`stable`) or after five weeks (`week5`) of notification.
424423

425424
The optional `settings.insights_config` subblock for instances declares Query Insights([MySQL](https://cloud.google.com/sql/docs/mysql/using-query-insights), [PostgreSQL](https://cloud.google.com/sql/docs/postgres/using-query-insights)) configuration. It contains:
426425

0 commit comments

Comments
 (0)