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