@@ -2078,6 +2078,41 @@ func TestAccSqlDatabaseInstance_rootPasswordShouldBeUpdatable(t *testing.T) {
2078
2078
})
2079
2079
}
2080
2080
2081
+ func TestAccSqlDatabaseInstance_SqlServerTimezoneUpdate (t * testing.T ) {
2082
+ t .Parallel ()
2083
+
2084
+ instanceName := "tf-test-" + acctest .RandString (t , 10 )
2085
+ rootPassword := acctest .RandString (t , 15 )
2086
+ timezone := "Eastern Standard Time"
2087
+ timezoneUpdate := "Pacific Standard Time"
2088
+
2089
+ acctest .VcrTest (t , resource.TestCase {
2090
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
2091
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
2092
+ CheckDestroy : testAccSqlDatabaseInstanceDestroyProducer (t ),
2093
+ Steps : []resource.TestStep {
2094
+ {
2095
+ Config : testGoogleSqlDatabaseInstance_SqlServerTimezone (instanceName , rootPassword , timezone ),
2096
+ },
2097
+ {
2098
+ ResourceName : "google_sql_database_instance.instance" ,
2099
+ ImportState : true ,
2100
+ ImportStateVerify : true ,
2101
+ ImportStateVerifyIgnore : []string {"deletion_protection" , "root_password" },
2102
+ },
2103
+ {
2104
+ Config : testGoogleSqlDatabaseInstance_SqlServerTimezone (instanceName , rootPassword , timezoneUpdate ),
2105
+ },
2106
+ {
2107
+ ResourceName : "google_sql_database_instance.instance" ,
2108
+ ImportState : true ,
2109
+ ImportStateVerify : true ,
2110
+ ImportStateVerifyIgnore : []string {"deletion_protection" , "root_password" },
2111
+ },
2112
+ },
2113
+ })
2114
+ }
2115
+
2081
2116
func TestAccSqlDatabaseInstance_activationPolicy (t * testing.T ) {
2082
2117
t .Parallel ()
2083
2118
@@ -2686,6 +2721,25 @@ resource "google_sql_database_instance" "instance" {
2686
2721
}` , instanceName , tier , edition )
2687
2722
}
2688
2723
2724
+ func testGoogleSqlDatabaseInstance_SqlServerTimezone (instance , rootPassword , timezone string ) string {
2725
+ return fmt .Sprintf (`
2726
+ resource "google_sql_database_instance" "instance" {
2727
+ name = "%s"
2728
+ region = "us-central1"
2729
+ database_version = "SQLSERVER_2017_STANDARD"
2730
+ root_password = "%s"
2731
+ deletion_protection = false
2732
+ settings {
2733
+ tier = "db-custom-1-3840"
2734
+ ip_configuration {
2735
+ ipv4_enabled = "true"
2736
+ }
2737
+ time_zone = "%s"
2738
+ }
2739
+ }
2740
+ ` , instance , rootPassword , timezone )
2741
+ }
2742
+
2689
2743
func testGoogleSqlDatabaseInstance_SqlServerAuditConfig (databaseName , rootPassword , bucketName , uploadInterval , retentionInterval string ) string {
2690
2744
return fmt .Sprintf (`
2691
2745
resource "google_storage_bucket" "gs-bucket" {
0 commit comments