From 2ad219fcb451f2c633eb522fcd53ff6c8d5dbf53 Mon Sep 17 00:00:00 2001 From: Deepak Selvakumar <77007253+deepaksibm@users.noreply.github.com> Date: Mon, 20 Mar 2023 12:24:54 +0530 Subject: [PATCH] set instance_count in instance group read --- ibm/service/vpc/resource_ibm_is_instance_group.go | 1 + ibm/service/vpc/resource_ibm_is_instance_group_test.go | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ibm/service/vpc/resource_ibm_is_instance_group.go b/ibm/service/vpc/resource_ibm_is_instance_group.go index f673690fc3..0b3ca53739 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_group.go +++ b/ibm/service/vpc/resource_ibm_is_instance_group.go @@ -413,6 +413,7 @@ func resourceIBMISInstanceGroupRead(d *schema.ResourceData, meta interface{}) er d.Set("name", *instanceGroup.Name) d.Set("instance_template", *instanceGroup.InstanceTemplate.ID) d.Set("instances", *instanceGroup.MembershipCount) + d.Set("instance_count", *instanceGroup.MembershipCount) d.Set("resource_group", *instanceGroup.ResourceGroup.ID) if instanceGroup.ApplicationPort != nil { d.Set("application_port", *instanceGroup.ApplicationPort) diff --git a/ibm/service/vpc/resource_ibm_is_instance_group_test.go b/ibm/service/vpc/resource_ibm_is_instance_group_test.go index 5ffaea3912..85e863bfb6 100644 --- a/ibm/service/vpc/resource_ibm_is_instance_group_test.go +++ b/ibm/service/vpc/resource_ibm_is_instance_group_test.go @@ -161,7 +161,7 @@ func testAccCheckIBMISInstanceGrouplbConfig(vpcname, subnetname, zone, cidr, nam resource "ibm_is_instance_template" "instancetemplate1" { name = "%s" - image = "r134-63363662-a4ee-4ba4-a6c4-92e6c78c6b58" + image = "%s" profile = "bx2-8x32" primary_network_interface { @@ -182,15 +182,13 @@ func testAccCheckIBMISInstanceGrouplbConfig(vpcname, subnetname, zone, cidr, nam load_balancer_pool = ibm_is_lb_pool.testacc_lb_pool.pool_id application_port = "2364" } - `, vpcname, subnetname, zone, cidr, name, poolName, algorithm, protocol, delay, retries, timeout, healthType, sshKeyName, publicKey, templateName, zone, instanceGroupName) + `, vpcname, subnetname, zone, cidr, name, poolName, algorithm, protocol, delay, retries, timeout, healthType, sshKeyName, publicKey, templateName, acc.IsImage, zone, instanceGroupName) } func testAccCheckIBMISInstanceGroupConfig(vpcName, subnetName, sshKeyName, publicKey, templateName, instanceGroupName string) string { return fmt.Sprintf(` - provider "ibm" { - generation = 2 - } + resource "ibm_is_vpc" "vpc2" { name = "%s"