Skip to content

Commit

Permalink
Adding support for week5 maintenance update track (GoogleCloudPlatfor…
Browse files Browse the repository at this point in the history
…m#10732)

Co-authored-by: Ashish Jindal <[email protected]>
  • Loading branch information
ashishgoogle and Ashish Jindal authored May 22, 2024
1 parent 1a16c4f commit 931670a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ is set to true. Defaults to ZONAL.`,
Type: schema.TypeString,
Optional: true,
AtLeastOneOf: maintenanceWindowKeys,
Description: `Receive updates earlier (canary) or later (stable)`,
Description: `Receive updates after one week (canary) or after two weeks (stable) or after five weeks (week5) of notification.`,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,30 @@ func TestAccSqlDatabaseInstance_maintenance(t *testing.T) {
})
}

func TestAccSqlDatabaseInstance_maintenance_update_track_week5(t *testing.T) {
t.Parallel()

masterID := acctest.RandInt(t)

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccSqlDatabaseInstanceDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: fmt.Sprintf(
testGoogleSqlDatabaseInstance_maintenance_week5, masterID),
},
{
ResourceName: "google_sql_database_instance.instance",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"deletion_protection"},
},
},
})
}

func TestAccSqlDatabaseInstance_settings_upgrade(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -3632,6 +3656,25 @@ resource "google_sql_database_instance" "instance" {
}
`

var testGoogleSqlDatabaseInstance_maintenance_week5 = `
resource "google_sql_database_instance" "instance" {
name = "tf-test-%d"
region = "us-central1"
database_version = "MYSQL_5_7"
deletion_protection = false
settings {
tier = "db-f1-micro"
maintenance_window {
day = 7
hour = 3
update_track = "week5"
}
}
}
`

var testGoogleSqlDatabaseInstance_authNets_step1 = `
resource "google_sql_database_instance" "instance" {
name = "tf-test-%d"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ when an Instance can automatically restart to apply updates. The maintenance win

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

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

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:

Expand Down

0 comments on commit 931670a

Please sign in to comment.