@@ -1366,16 +1366,26 @@ func TestAccSqlDatabaseInstance_EnableGoogleMlIntegration(t *testing.T) {
1366
1366
CheckDestroy : testAccSqlDatabaseInstanceDestroyProducer (t ),
1367
1367
Steps : []resource.TestStep {
1368
1368
{
1369
- Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , true , "POSTGRES_14" ),
1369
+ Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , true , "POSTGRES_14" , "db-custom-2-13312" ),
1370
1370
},
1371
1371
{
1372
1372
ResourceName : "google_sql_database_instance.instance" ,
1373
1373
ImportState : true ,
1374
1374
ImportStateVerify : true ,
1375
1375
ImportStateVerifyIgnore : []string {"deletion_protection" , "root_password" },
1376
1376
},
1377
+ // Test that updates to other settings work after google-ml-integration is enabled
1377
1378
{
1378
- Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , false , "POSTGRES_14" ),
1379
+ Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , true , "POSTGRES_14" , "db-custom-2-10240" ),
1380
+ },
1381
+ {
1382
+ ResourceName : "google_sql_database_instance.instance" ,
1383
+ ImportState : true ,
1384
+ ImportStateVerify : true ,
1385
+ ImportStateVerifyIgnore : []string {"deletion_protection" , "root_password" },
1386
+ },
1387
+ {
1388
+ Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , false , "POSTGRES_14" , "db-custom-2-10240" ),
1379
1389
},
1380
1390
{
1381
1391
ResourceName : "google_sql_database_instance.instance" ,
@@ -3891,7 +3901,7 @@ resource "google_sql_database_instance" "instance" {
3891
3901
` , masterID , dbVersion , masterID , pointInTimeRecoveryEnabled )
3892
3902
}
3893
3903
3894
- func testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID int , enableGoogleMlIntegration bool , dbVersion string ) string {
3904
+ func testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID int , enableGoogleMlIntegration bool , dbVersion string , tier string ) string {
3895
3905
return fmt .Sprintf (`
3896
3906
resource "google_sql_database_instance" "instance" {
3897
3907
name = "tf-test-%d"
@@ -3900,11 +3910,11 @@ resource "google_sql_database_instance" "instance" {
3900
3910
deletion_protection = false
3901
3911
root_password = "rand-pwd-%d"
3902
3912
settings {
3903
- tier = "db-custom-2-13312 "
3913
+ tier = "%s "
3904
3914
enable_google_ml_integration = %t
3905
3915
}
3906
3916
}
3907
- ` , masterID , dbVersion , masterID , enableGoogleMlIntegration )
3917
+ ` , masterID , dbVersion , masterID , tier , enableGoogleMlIntegration )
3908
3918
}
3909
3919
3910
3920
func testGoogleSqlDatabaseInstance_BackupRetention (masterID int ) string {
0 commit comments