From 1853aa951148c03b11297ef9d91fbe1055c228b3 Mon Sep 17 00:00:00 2001 From: Alex Hemard Date: Fri, 13 Dec 2024 14:07:17 -0600 Subject: [PATCH] fix(Cloud Databases): send host flavor with scaling requests --- ibm/service/database/resource_ibm_database.go | 4 ++-- ibm/service/database/resource_ibm_database_postgresql_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ibm/service/database/resource_ibm_database.go b/ibm/service/database/resource_ibm_database.go index a0d2ab72a0..083806f815 100644 --- a/ibm/service/database/resource_ibm_database.go +++ b/ibm/service/database/resource_ibm_database.go @@ -1313,7 +1313,7 @@ func resourceIBMDatabaseInstanceCreate(context context.Context, d *schema.Resour if g.CPU != nil && g.CPU.Allocation*nodeCount != currentGroup.CPU.Allocation { groupScaling.CPU = &clouddatabasesv5.GroupScalingCPU{AllocationCount: core.Int64Ptr(int64(g.CPU.Allocation * nodeCount))} } - if g.HostFlavor != nil && g.HostFlavor.ID != currentGroup.HostFlavor.ID { + if g.HostFlavor != nil { groupScaling.HostFlavor = &clouddatabasesv5.GroupScalingHostFlavor{ID: core.StringPtr(g.HostFlavor.ID)} } @@ -1882,7 +1882,7 @@ func resourceIBMDatabaseInstanceUpdate(context context.Context, d *schema.Resour if group.CPU != nil && group.CPU.Allocation*nodeCount != currentGroup.CPU.Allocation { groupScaling.CPU = &clouddatabasesv5.GroupScalingCPU{AllocationCount: core.Int64Ptr(int64(group.CPU.Allocation * nodeCount))} } - if group.HostFlavor != nil && group.HostFlavor.ID != currentGroup.HostFlavor.ID { + if group.HostFlavor != nil { groupScaling.HostFlavor = &clouddatabasesv5.GroupScalingHostFlavor{ID: core.StringPtr(group.HostFlavor.ID)} } diff --git a/ibm/service/database/resource_ibm_database_postgresql_test.go b/ibm/service/database/resource_ibm_database_postgresql_test.go index 1e1e8a8173..45debbf40a 100644 --- a/ibm/service/database/resource_ibm_database_postgresql_test.go +++ b/ibm/service/database/resource_ibm_database_postgresql_test.go @@ -142,7 +142,7 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "groups.0.count", "3"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "24576"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "21504"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "9"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"),