diff --git a/go.mod b/go.mod index 08815b692ba..90c014f351d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca github.com/IBM/appconfiguration-go-admin-sdk v0.3.0 github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f - github.com/IBM/cloud-databases-go-sdk v0.5.0 + github.com/IBM/cloud-databases-go-sdk v0.6.0 github.com/IBM/cloudant-go-sdk v0.0.43 github.com/IBM/code-engine-go-sdk v0.0.0-20231106200405-99e81b3ee752 github.com/IBM/container-registry-go-sdk v1.1.0 diff --git a/go.sum b/go.sum index fb229b47cd9..023d34bb277 100644 --- a/go.sum +++ b/go.sum @@ -118,6 +118,8 @@ github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f h1:4c1 github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f/go.mod h1:d22kTYY7RYBWcQlZpqrSdshpB/lJ16viWS5Sbjtlc8s= github.com/IBM/cloud-databases-go-sdk v0.5.0 h1:Bie6MnT1jLchQmtKVA20HHETTPdlOR+i11P2kJ55viM= github.com/IBM/cloud-databases-go-sdk v0.5.0/go.mod h1:nCIVfeZnhBYIiwByT959dFP4VWUeNLxomDYy63tTC6M= +github.com/IBM/cloud-databases-go-sdk v0.6.0 h1:QK3eif7+kusgeuMB54Zw5nco/kDwsDg2sD/84/foDxo= +github.com/IBM/cloud-databases-go-sdk v0.6.0/go.mod h1:nCIVfeZnhBYIiwByT959dFP4VWUeNLxomDYy63tTC6M= github.com/IBM/cloudant-go-sdk v0.0.43 h1:YxTy4RpAEezX32YIWnds76hrBREmO4u6IkBz1WylNuQ= github.com/IBM/cloudant-go-sdk v0.0.43/go.mod h1:WeYrJPaHTw19943ndWnVfwMIlZ5z0XUM2uEXNBrwZ1M= github.com/IBM/code-engine-go-sdk v0.0.0-20231106200405-99e81b3ee752 h1:S5NT0aKKUqd9hnIrPN/qUijKx9cZjJi3kfFpog0ByDA= diff --git a/ibm/service/database/resource_ibm_database.go b/ibm/service/database/resource_ibm_database.go index 180823b07fe..f477e76aeeb 100644 --- a/ibm/service/database/resource_ibm_database.go +++ b/ibm/service/database/resource_ibm_database.go @@ -596,6 +596,16 @@ func ResourceIBMDatabaseInstance() *schema.Resource { Computed: true, Description: "Can memory scale down as well as up.", }, + "cpu_enforcement_ratio_ceiling_mb": { + Type: schema.TypeInt, + Optional: true, + Description: "The amount of memory required before the cpu/memory ratio is no longer enforced. (multitenant only).", + }, + "cpu_enforcement_ratio_mb": { + Type: schema.TypeInt, + Optional: true, + Description: "The maximum memory allowed per CPU until the ratio ceiling is reached. (multitenant only).", + }, }, }, }, @@ -987,21 +997,23 @@ type Group struct { } type GroupResource struct { - Units string - Allocation int - Minimum int - Maximum int - StepSize int - IsAdjustable bool - IsOptional bool - CanScaleDown bool + Units string + Allocation int + Minimum int + Maximum int + StepSize int + IsAdjustable bool + IsOptional bool + CanScaleDown bool + CPUEnforcementRatioCeilingMb int + CPUEnforcementRatioMb int } type HostFlavorGroupResource struct { ID string } -func getDefaultScalingGroups(_service string, _plan string, meta interface{}) (groups []clouddatabasesv5.Group, err error) { +func getDefaultScalingGroups(_service string, _plan string, _hostFlavor string, meta interface{}) (groups []clouddatabasesv5.Group, err error) { cloudDatabasesClient, err := meta.(conns.ClientSession).CloudDatabasesV5() if err != nil { return groups, fmt.Errorf("[ERROR] Error getting database client settings: %s", err) @@ -1033,6 +1045,9 @@ func getDefaultScalingGroups(_service string, _plan string, meta interface{}) (g } getDefaultScalingGroupsOptions := cloudDatabasesClient.NewGetDefaultScalingGroupsOptions(service) + if _hostFlavor != "" { + getDefaultScalingGroupsOptions.SetHostFlavor(_hostFlavor) + } getDefaultScalingGroupsResponse, _, err := cloudDatabasesClient.GetDefaultScalingGroups(getDefaultScalingGroupsOptions) if err != nil { @@ -1043,7 +1058,7 @@ func getDefaultScalingGroups(_service string, _plan string, meta interface{}) (g } func getInitialNodeCount(service string, plan string, meta interface{}) (int, error) { - groups, err := getDefaultScalingGroups(service, plan, meta) + groups, err := getDefaultScalingGroups(service, plan, "", meta) if err != nil { return 0, err @@ -2702,14 +2717,16 @@ func normalizeGroups(_groups []clouddatabasesv5.Group) (groups []Group) { } group.Memory = &GroupResource{ - Units: *g.Memory.Units, - Allocation: int(*g.Memory.AllocationMb), - Minimum: int(*g.Memory.MinimumMb), - Maximum: int(*g.Memory.MaximumMb), - StepSize: int(*g.Memory.StepSizeMb), - IsAdjustable: *g.Memory.IsAdjustable, - IsOptional: *g.Memory.IsOptional, - CanScaleDown: *g.Memory.CanScaleDown, + Units: *g.Memory.Units, + Allocation: int(*g.Memory.AllocationMb), + Minimum: int(*g.Memory.MinimumMb), + Maximum: int(*g.Memory.MaximumMb), + StepSize: int(*g.Memory.StepSizeMb), + IsAdjustable: *g.Memory.IsAdjustable, + IsOptional: *g.Memory.IsOptional, + CanScaleDown: *g.Memory.CanScaleDown, + CPUEnforcementRatioCeilingMb: getCPUEnforcementRatioCeilingMb(g.Memory), + CPUEnforcementRatioMb: getCPUEnforcementRatioMb(g.Memory), } group.Disk = &GroupResource{ @@ -2745,6 +2762,22 @@ func normalizeGroups(_groups []clouddatabasesv5.Group) (groups []Group) { return groups } +func getCPUEnforcementRatioCeilingMb(groupMemory *clouddatabasesv5.GroupMemory) int { + if groupMemory.CPUEnforcementRatioCeilingMb != nil { + return int(*groupMemory.CPUEnforcementRatioCeilingMb) + } + + return 0 +} + +func getCPUEnforcementRatioMb(groupMemory *clouddatabasesv5.GroupMemory) int { + if groupMemory.CPUEnforcementRatioMb != nil { + return int(*groupMemory.CPUEnforcementRatioMb) + } + + return 0 +} + func expandGroups(_groups []interface{}) []*Group { if len(_groups) == 0 { return nil @@ -2837,6 +2870,21 @@ func validateGroupHostFlavor(groupId string, resourceName string, group *Group) return nil } +func validateMultitenantMemoryCpu(resourceDefaults *Group, group *Group, cpuEnforcementRatioCeiling int, cpuEnforcementRatioMb int) error { + // TODO: Replace this with cpuEnforcementRatioCeiling when it is fixed + cpuEnforcementRatioCeilingTemp := 16384 + + if group.CPU == nil || group.CPU.Allocation == 0 { + return nil + } + + if group.CPU.Allocation >= cpuEnforcementRatioCeilingTemp/cpuEnforcementRatioMb { + return nil + } else { + return fmt.Errorf("The current cpu alloaction of %d is not valid for your current configuration.", group.CPU.Allocation) + } +} + func validateGroupsDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) (err error) { instanceID := diff.Id() service := diff.Get("service").(string) @@ -2846,11 +2894,23 @@ func validateGroupsDiff(_ context.Context, diff *schema.ResourceDiff, meta inter var currentGroups []Group var groupList []clouddatabasesv5.Group var groupIds []string + groups := expandGroups(group.(*schema.Set).List()) + var memberGroup *Group + for _, g := range groups { + if g.ID == "member" { + memberGroup = g + break + } + } if instanceID != "" { groupList, err = getGroups(instanceID, meta) } else { - groupList, err = getDefaultScalingGroups(service, plan, meta) + if memberGroup.HostFlavor != nil { + groupList, err = getDefaultScalingGroups(service, plan, memberGroup.HostFlavor.ID, meta) + } else { + groupList, err = getDefaultScalingGroups(service, plan, "", meta) + } } if err != nil { @@ -2861,6 +2921,12 @@ func validateGroupsDiff(_ context.Context, diff *schema.ResourceDiff, meta inter tfGroups := expandGroups(group.(*schema.Set).List()) + err, cpuEnforcementRatioCeiling, cpuEnforcementRatioMb := getCpuEnforcementRatios(service, plan, meta, group) + + if err != nil { + return err + } + // validate group_ids are unique groupIds = make([]string, 0, len(tfGroups)) for _, g := range tfGroups { @@ -2892,15 +2958,15 @@ func validateGroupsDiff(_ context.Context, diff *schema.ResourceDiff, meta inter // set current nodeCount nodeCount := groupDefaults.Members.Allocation - if group.Members != nil { - err = validateGroupScaling(groupId, "members", group.Members.Allocation, groupDefaults.Members, 1) + if group.HostFlavor != nil && group.HostFlavor.ID != "" && group.HostFlavor.ID != "multitenant" { + err = validateGroupHostFlavor(groupId, "host_flavor", group) if err != nil { return err } } - if group.HostFlavor != nil && group.HostFlavor.ID != "" && group.HostFlavor.ID != "multitenant" { - err = validateGroupHostFlavor(groupId, "host_flavor", group) + if group.Members != nil { + err = validateGroupScaling(groupId, "members", group.Members.Allocation, groupDefaults.Members, 1) if err != nil { return err } @@ -2911,6 +2977,13 @@ func validateGroupsDiff(_ context.Context, diff *schema.ResourceDiff, meta inter if err != nil { return err } + + if group.HostFlavor != nil && group.HostFlavor.ID != "" && group.HostFlavor.ID == "multitenant" && cpuEnforcementRatioCeiling != 0 && cpuEnforcementRatioMb != 0 { + err = validateMultitenantMemoryCpu(groupDefaults, group, cpuEnforcementRatioCeiling, cpuEnforcementRatioMb) + if err != nil { + return err + } + } } if group.Disk != nil { @@ -2932,6 +3005,41 @@ func validateGroupsDiff(_ context.Context, diff *schema.ResourceDiff, meta inter return nil } +func getCpuEnforcementRatios(service string, plan string, meta interface{}, group interface{}) (err error, cpuEnforcementRatioCeiling int, cpuEnforcementRatioMb int) { + var currentGroups []Group + defaultList, err := getDefaultScalingGroups(service, plan, "multitenant", meta) + + if err != nil { + return err, 0, 0 + } + + currentGroups = normalizeGroups(defaultList) + tfGroups := expandGroups(group.(*schema.Set).List()) + + // Get default or current group scaling values + for _, group := range tfGroups { + if group == nil { + continue + } + + groupId := group.ID + var groupDefaults *Group + for _, g := range currentGroups { + if g.ID == groupId { + groupDefaults = &g + break + } + } + + if groupDefaults.Memory != nil { + return nil, groupDefaults.Memory.CPUEnforcementRatioCeilingMb, groupDefaults.Memory.CPUEnforcementRatioMb + } + + } + + return nil, 0, 0 +} + func validateUsersDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) (err error) { service := diff.Get("service").(string) @@ -2972,7 +3080,7 @@ func validateUsersDiff(_ context.Context, diff *schema.ResourceDiff, meta interf // TODO: Use Capability API // RBAC roles supported for Redis 6.0 and above - if service == "databases-for-redis" && !(version > 0 && version < 6) { + if (service == "databases-for-redis") && !(version > 0 && version < 6) { err = change.New.ValidateRBACRole() } else if service == "databases-for-mongodb" && change.New.Type == "ops_manager" { err = change.New.ValidateOpsManagerRole() diff --git a/ibm/service/database/resource_ibm_database_elasticsearch_test.go b/ibm/service/database/resource_ibm_database_elasticsearch_test.go index 213463b0eec..b365fb81f89 100644 --- a/ibm/service/database/resource_ibm_database_elasticsearch_test.go +++ b/ibm/service/database/resource_ibm_database_elasticsearch_test.go @@ -78,7 +78,7 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-elasticsearch"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), resource.TestCheckResourceAttr(name, "users.#", "0"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -213,7 +213,7 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(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", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "9"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), @@ -231,7 +231,7 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(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", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "18432"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "9"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), @@ -248,7 +248,7 @@ func TestAccIBMDatabaseInstance_Elasticsearch_Group(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "groups.0.count", "4"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "15360"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "24576"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "12"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), @@ -329,7 +329,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchBasic(databaseResourceGroup str group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -379,7 +379,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchFullyspecified(databaseResource group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -414,7 +414,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchReduced(databaseResourceGroup s group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -449,7 +449,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchGroupMigration(databaseResource group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -489,7 +489,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeBasic(databaseResourceGroup allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 5120 @@ -539,7 +539,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeFullyspecified(databaseReso allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 5120 } disk { allocation_mb = 6144 @@ -597,7 +597,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeReduced(databaseResourceGro allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 6144 @@ -639,7 +639,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchNodeScaleOut(databaseResourceGr allocation_count = 4 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 6144 @@ -682,7 +682,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchGroupBasic(databaseResourceGrou allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 5120 @@ -734,7 +734,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchGroupFullyspecified(databaseRes allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 6144 @@ -794,7 +794,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchGroupReduced(databaseResourceGr allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 6144 @@ -837,7 +837,7 @@ func testAccCheckIBMDatabaseInstanceElasticsearchGroupScaleOut(databaseResourceG allocation_count = 4 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 6144 diff --git a/ibm/service/database/resource_ibm_database_etcd_test.go b/ibm/service/database/resource_ibm_database_etcd_test.go index b289705b931..bd279f277cb 100644 --- a/ibm/service/database/resource_ibm_database_etcd_test.go +++ b/ibm/service/database/resource_ibm_database_etcd_test.go @@ -36,7 +36,7 @@ func TestAccIBMDatabaseInstance_Etcd_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "adminuser", "root"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "9216"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "184320"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -69,7 +69,7 @@ func TestAccIBMDatabaseInstance_Etcd_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-etcd"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "9216"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "193536"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), @@ -135,7 +135,7 @@ func testAccCheckIBMDatabaseInstanceEtcdBasic(databaseResourceGroup string, name group { group_id = "member" memory { - allocation_mb = 3072 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -217,7 +217,7 @@ func testAccCheckIBMDatabaseInstanceEtcdReduced(databaseResourceGroup string, na group { group_id = "member" memory { - allocation_mb = 3072 + allocation_mb = 4096 } host_flavor { id = "multitenant" diff --git a/ibm/service/database/resource_ibm_database_mongodb_test.go b/ibm/service/database/resource_ibm_database_mongodb_test.go index 83e6e2266de..7f4d31b37bd 100644 --- a/ibm/service/database/resource_ibm_database_mongodb_test.go +++ b/ibm/service/database/resource_ibm_database_mongodb_test.go @@ -38,7 +38,7 @@ func TestAccIBMDatabaseInstanceMongodbBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "adminuser", "admin"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "2"), resource.TestCheckResourceAttr(name, "connectionstrings.1.name", "admin"), @@ -56,7 +56,7 @@ func TestAccIBMDatabaseInstanceMongodbBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "15360"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "3"), resource.TestCheckResourceAttr(name, "connectionstrings.2.name", "admin"), @@ -71,7 +71,7 @@ func TestAccIBMDatabaseInstanceMongodbBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mongodb"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), @@ -139,7 +139,7 @@ func testAccCheckIBMDatabaseInstanceMongodbBasic(databaseResourceGroup string, n group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -176,7 +176,7 @@ func testAccCheckIBMDatabaseInstanceMongodbFullyspecified(databaseResourceGroup group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 5120 } host_flavor { id = "multitenant" @@ -221,7 +221,7 @@ func testAccCheckIBMDatabaseInstanceMongodbReduced(databaseResourceGroup string, group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 4096 } host_flavor { id = "multitenant" diff --git a/ibm/service/database/resource_ibm_database_mysql_test.go b/ibm/service/database/resource_ibm_database_mysql_test.go index eb5030098bb..3a1f7e4b1f3 100644 --- a/ibm/service/database/resource_ibm_database_mysql_test.go +++ b/ibm/service/database/resource_ibm_database_mysql_test.go @@ -35,7 +35,7 @@ func TestAccIBMMysqlDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "12288"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "61440"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), @@ -55,7 +55,7 @@ func TestAccIBMMysqlDatabaseInstanceBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-mysql"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "15360"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "92160"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), @@ -90,7 +90,7 @@ func testAccCheckIBMDatabaseInstanceMysqlBasic(databaseResourceGroup string, nam group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -133,7 +133,7 @@ func testAccCheckIBMDatabaseInstanceMysqlFullyspecified(databaseResourceGroup st group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 5120 } disk { allocation_mb = 30720 diff --git a/ibm/service/database/resource_ibm_database_postgresql_test.go b/ibm/service/database/resource_ibm_database_postgresql_test.go index a75ee7fa403..2dd639ff581 100644 --- a/ibm/service/database/resource_ibm_database_postgresql_test.go +++ b/ibm/service/database/resource_ibm_database_postgresql_test.go @@ -57,7 +57,7 @@ func TestAccIBMDatabaseInstancePostgresBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "4096"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "20480"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "0"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), @@ -79,7 +79,7 @@ func TestAccIBMDatabaseInstancePostgresBasic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-postgresql"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "16384"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "28672"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), @@ -127,7 +127,7 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "adminuser", "admin"), resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "10240"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), resource.TestCheckResourceAttr(name, "service_endpoints", "public"), @@ -149,7 +149,7 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2304"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "16384"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "14336"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), resource.TestCheckResourceAttr(name, "service_endpoints", "public-and-private"), @@ -174,7 +174,7 @@ func TestAccIBMDatabaseInstancePostgresGroup(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "groups.0.count", "2"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "14336"), resource.TestCheckResourceAttr(name, "groups.0.cpu.0.allocation_count", "6"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), @@ -192,7 +192,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", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), 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"), @@ -419,7 +419,7 @@ func testAccCheckIBMDatabaseInstancePostgresBasic(databaseResourceGroup string, group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -469,7 +469,7 @@ func testAccCheckIBMDatabaseInstancePostgresFullyspecified(databaseResourceGroup group { group_id = "member" memory { - allocation_mb = 4096 + allocation_mb = 8192 } disk { allocation_mb = 14336 @@ -544,7 +544,7 @@ func testAccCheckIBMDatabaseInstancePostgresGroupBasic(databaseResourceGroup str allocation_count = 2 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 5120 @@ -589,7 +589,7 @@ func testAccCheckIBMDatabaseInstancePostgresGroupFullyspecified(databaseResource allocation_count = 2 } memory { - allocation_mb = 1152 + allocation_mb = 8192 } disk { allocation_mb = 7168 @@ -642,7 +642,7 @@ func testAccCheckIBMDatabaseInstancePostgresGroupReduced(databaseResourceGroup s allocation_count = 2 } memory { - allocation_mb = 1024 + allocation_mb = 4096 } disk { allocation_mb = 7168 @@ -677,7 +677,7 @@ func testAccCheckIBMDatabaseInstancePostgresGroupScaleOut(databaseResourceGroup allocation_count = 3 } memory { - allocation_mb = 1024 + allocation_mb = 8192 } disk { allocation_mb = 7168 diff --git a/ibm/service/database/resource_ibm_database_rabbitmq_test.go b/ibm/service/database/resource_ibm_database_rabbitmq_test.go index abc7c94ad2a..7fa54800cf7 100644 --- a/ibm/service/database/resource_ibm_database_rabbitmq_test.go +++ b/ibm/service/database/resource_ibm_database_rabbitmq_test.go @@ -35,7 +35,7 @@ func TestAccIBMDatabaseInstance_Rabbitmq_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "24576"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "3072"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "users.#", "1"), @@ -53,7 +53,7 @@ func TestAccIBMDatabaseInstance_Rabbitmq_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "messages-for-rabbitmq"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "6144"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "30720"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "6144"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), resource.TestCheckResourceAttr(name, "users.#", "2"), @@ -69,7 +69,7 @@ func TestAccIBMDatabaseInstance_Rabbitmq_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "messages-for-rabbitmq"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "3072"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "24576"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "6144"), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), resource.TestCheckResourceAttr(name, "users.#", "0"), @@ -140,7 +140,7 @@ func testAccCheckIBMDatabaseInstanceRabbitmqBasic(databaseResourceGroup string, group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 8192 } host_flavor { id = "multitenant" @@ -183,7 +183,7 @@ func testAccCheckIBMDatabaseInstanceRabbitmqFullyspecified(databaseResourceGroup group { group_id = "member" memory { - allocation_mb = 2048 + allocation_mb = 10240 } host_flavor { id = "multitenant" @@ -230,7 +230,7 @@ func testAccCheckIBMDatabaseInstanceRabbitmqReduced(databaseResourceGroup string group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 8192 } host_flavor { id = "multitenant" diff --git a/ibm/service/database/resource_ibm_database_redis_test.go b/ibm/service/database/resource_ibm_database_redis_test.go index 06749e11213..a71df9d4ce9 100644 --- a/ibm/service/database/resource_ibm_database_redis_test.go +++ b/ibm/service/database/resource_ibm_database_redis_test.go @@ -36,7 +36,7 @@ func TestAccIBMDatabaseInstance_Redis_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "adminuser", "admin"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "2048"), resource.TestCheckResourceAttr(name, "allowlist.#", "1"), resource.TestCheckResourceAttr(name, "connectionstrings.#", "1"), @@ -52,7 +52,7 @@ func TestAccIBMDatabaseInstance_Redis_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "service", "databases-for-redis"), resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2304"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "10240"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "4096"), resource.TestCheckResourceAttr(name, "allowlist.#", "2"), ), @@ -65,7 +65,7 @@ func TestAccIBMDatabaseInstance_Redis_Basic(t *testing.T) { resource.TestCheckResourceAttr(name, "plan", "standard"), resource.TestCheckResourceAttr(name, "location", acc.Region()), resource.TestCheckResourceAttr(name, "allowlist.#", "0"), - resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "2048"), + resource.TestCheckResourceAttr(name, "groups.0.memory.0.allocation_mb", "8192"), resource.TestCheckResourceAttr(name, "groups.0.disk.0.allocation_mb", "4096"), ), }, @@ -173,7 +173,7 @@ func testAccCheckIBMDatabaseInstanceRedisBasic(databaseResourceGroup string, nam group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -216,7 +216,7 @@ func testAccCheckIBMDatabaseInstanceRedisFullyspecified(databaseResourceGroup st group { group_id = "member" memory { - allocation_mb = 1152 + allocation_mb = 5120 } host_flavor { id = "multitenant" @@ -254,7 +254,7 @@ func testAccCheckIBMDatabaseInstanceRedisReduced(databaseResourceGroup string, n group { group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 4096 } host_flavor { id = "multitenant" @@ -285,7 +285,7 @@ func testAccCheckIBMDatabaseInstanceRedisUserRole(databaseResourceGroup string, group_id = "member" memory { - allocation_mb = 1024 + allocation_mb = 8192 } host_flavor { id = "multitenant"