@@ -1366,16 +1366,26 @@ func TestAccSqlDatabaseInstance_EnableGoogleMlIntegration(t *testing.T) {
13661366 CheckDestroy : testAccSqlDatabaseInstanceDestroyProducer (t ),
13671367 Steps : []resource.TestStep {
13681368 {
1369- Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , true , "POSTGRES_14" ),
1369+ Config : testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID , true , "POSTGRES_14" , "db-custom-2-13312" ),
13701370 },
13711371 {
13721372 ResourceName : "google_sql_database_instance.instance" ,
13731373 ImportState : true ,
13741374 ImportStateVerify : true ,
13751375 ImportStateVerifyIgnore : []string {"deletion_protection" , "root_password" },
13761376 },
1377+ // Test that updates to other settings work after google-ml-integration is enabled
13771378 {
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" ),
13791389 },
13801390 {
13811391 ResourceName : "google_sql_database_instance.instance" ,
@@ -3891,7 +3901,7 @@ resource "google_sql_database_instance" "instance" {
38913901` , masterID , dbVersion , masterID , pointInTimeRecoveryEnabled )
38923902}
38933903
3894- func testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID int , enableGoogleMlIntegration bool , dbVersion string ) string {
3904+ func testGoogleSqlDatabaseInstance_EnableGoogleMlIntegration (masterID int , enableGoogleMlIntegration bool , dbVersion string , tier string ) string {
38953905 return fmt .Sprintf (`
38963906resource "google_sql_database_instance" "instance" {
38973907 name = "tf-test-%d"
@@ -3900,11 +3910,11 @@ resource "google_sql_database_instance" "instance" {
39003910 deletion_protection = false
39013911 root_password = "rand-pwd-%d"
39023912 settings {
3903- tier = "db-custom-2-13312 "
3913+ tier = "%s "
39043914 enable_google_ml_integration = %t
39053915 }
39063916}
3907- ` , masterID , dbVersion , masterID , enableGoogleMlIntegration )
3917+ ` , masterID , dbVersion , masterID , tier , enableGoogleMlIntegration )
39083918}
39093919
39103920func testGoogleSqlDatabaseInstance_BackupRetention (masterID int ) string {
0 commit comments