Skip to content

Commit

Permalink
enhancement(is_instance): support for lifecycle status and reasons in…
Browse files Browse the repository at this point in the history
… is_instance
  • Loading branch information
uibm committed Sep 15, 2022
1 parent 3156ea6 commit 4494a7b
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 16 deletions.
55 changes: 55 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,38 @@ func DataSourceIBMISInstance() *schema.Resource {
Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance network interfaces.",
},

isInstanceLifecycleState: {
Type: schema.TypeString,
Computed: true,
Description: "The lifecycle state of the virtual server instance.",
},
isInstanceLifecycleReasons: {
Type: schema.TypeList,
Computed: true,
Description: "The reasons for the current lifecycle_state (if any).",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
isInstanceLifecycleReasonsCode: {
Type: schema.TypeString,
Computed: true,
Description: "A snake case string succinctly identifying the reason for this lifecycle state.",
},

isInstanceLifecycleReasonsMessage: {
Type: schema.TypeString,
Computed: true,
Description: "An explanation of the reason for this lifecycle state.",
},

isInstanceLifecycleReasonsMoreInfo: {
Type: schema.TypeString,
Computed: true,
Description: "Link to documentation about the reason for this lifecycle state.",
},
},
},
},

isInstanceTags: {
Type: schema.TypeSet,
Computed: true,
Expand Down Expand Up @@ -881,6 +913,14 @@ func instanceGetByName(d *schema.ResourceData, meta interface{}, name string) er
}
d.Set(isInstanceInitKeys, initKeyList)
}
//set the lifecycle status, reasons
if instance.LifecycleState != nil {
d.Set(isInstanceLifecycleState, *instance.LifecycleState)
}
if instance.LifecycleReasons != nil {
d.Set(isInstanceLifecycleReasons, dataSourceInstanceFlattenLifecycleReasons(instance.LifecycleReasons))
}

if initParms.Password != nil && initParms.Password.EncryptedPassword != nil {
ciphertext := *initParms.Password.EncryptedPassword
password := base64.StdEncoding.EncodeToString(ciphertext)
Expand Down Expand Up @@ -1045,3 +1085,18 @@ func dataSourceInstanceDisksToMap(disksItem vpcv1.InstanceDisk) (disksMap map[st

return disksMap
}
func dataSourceInstanceFlattenLifecycleReasons(lifecycleReasons []vpcv1.LifecycleReason) (lifecycleReasonsList []map[string]interface{}) {
lifecycleReasonsList = make([]map[string]interface{}, 0)
for _, lr := range lifecycleReasons {
currentLR := map[string]interface{}{}
if lr.Code != nil && lr.Message != nil {
currentLR[isInstanceLifecycleReasonsCode] = *lr.Code
currentLR[isInstanceLifecycleReasonsMessage] = *lr.Message
if lr.MoreInfo != nil {
currentLR[isInstanceLifecycleReasonsMoreInfo] = *lr.MoreInfo
}
lifecycleReasonsList = append(lifecycleReasonsList, currentLR)
}
}
return lifecycleReasonsList
}
10 changes: 7 additions & 3 deletions ibm/service/vpc/data_source_ibm_is_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ func TestAccIBMISInstanceDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(
resName, "primary_network_interface.0.port_speed"),
resource.TestCheckResourceAttrSet(
resName, "availability_policy.#"),
resName, "availability_policy_host_failure"),
resource.TestCheckResourceAttrSet(
resName, "lifecycle_state"),
resource.TestCheckResourceAttr(
resName, "lifecycle_reasons.#", "0"),
),
},
},
Expand Down Expand Up @@ -96,7 +100,7 @@ resource "ibm_is_subnet" "testacc_subnet" {
resource "ibm_is_ssh_key" "testacc_sshkey" {
name = "%s"
public_key = file("../../test-fixtures/.ssh/id_rsa.pub")
public_key = file("./test-fixtures/.ssh/id_rsa.pub")
}
resource "ibm_is_instance" "testacc_instance" {
Expand All @@ -117,7 +121,7 @@ resource "ibm_is_instance" "testacc_instance" {
}
data "ibm_is_instance" "ds_instance" {
name = ibm_is_instance.testacc_instance.name
private_key = file("../../test-fixtures/.ssh/id_rsa")
private_key = file("./test-fixtures/.ssh/id_rsa")
passphrase = ""
}`, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, instanceName, acc.IsWinImage, acc.InstanceProfileName, acc.ISZoneName)
}
Expand Down
41 changes: 41 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,39 @@ func DataSourceIBMISInstances() *schema.Resource {
Computed: true,
Description: "The availability policy to use for this virtual server instance. The action to perform if the compute host experiences a failure.",
},

isInstanceLifecycleState: {
Type: schema.TypeString,
Computed: true,
Description: "The lifecycle state of the virtual server instance.",
},
isInstanceLifecycleReasons: {
Type: schema.TypeList,
Computed: true,
Description: "The reasons for the current lifecycle_state (if any).",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
isInstanceLifecycleReasonsCode: {
Type: schema.TypeString,
Computed: true,
Description: "A snake case string succinctly identifying the reason for this lifecycle state.",
},

isInstanceLifecycleReasonsMessage: {
Type: schema.TypeString,
Computed: true,
Description: "An explanation of the reason for this lifecycle state.",
},

isInstanceLifecycleReasonsMoreInfo: {
Type: schema.TypeString,
Computed: true,
Description: "Link to documentation about the reason for this lifecycle state.",
},
},
},
},

isInstanceStatusReasons: {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -934,6 +967,14 @@ func instancesList(d *schema.ResourceData, meta interface{}) error {
l[isInstanceGpu] = gpuList
}

//set the lifecycle status, reasons
if instance.LifecycleState != nil {
l[isInstanceLifecycleState] = *instance.LifecycleState
}
if instance.LifecycleReasons != nil {
l[isInstanceLifecycleReasons] = dataSourceInstanceFlattenLifecycleReasons(instance.LifecycleReasons)
}

l["zone"] = *instance.Zone.Name
if instance.Image != nil {
l["image"] = *instance.Image.ID
Expand Down
4 changes: 3 additions & 1 deletion ibm/service/vpc/data_source_ibm_is_instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
resource.TestCheckResourceAttrSet(resName, "instances.0.profile"),
resource.TestCheckResourceAttrSet(resName, "instances.0.vcpu.#"),
resource.TestCheckResourceAttrSet(resName, "instances.0.zone"),
resource.TestCheckResourceAttrSet(resName, "instances.0.availability_policy.#"),
resource.TestCheckResourceAttrSet(resName, "instances.0.availability_policy_host_failure"),
resource.TestCheckResourceAttrSet(resName, "instances.0.lifecycle_state"),
resource.TestCheckResourceAttr(resName, "instances.0.lifecycle_reasons.#", "0"),
),
},
},
Expand Down
68 changes: 56 additions & 12 deletions ibm/service/vpc/resource_ibm_is_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,23 @@ const (
isInstanceStatusFailed = "failed"
isInstanceAvailablePolicyHostFailure = "availability_policy_host_failure"

isInstanceBootAttachmentName = "name"
isInstanceBootVolumeId = "volume_id"
isInstanceBootSize = "size"
isInstanceBootIOPS = "iops"
isInstanceBootEncryption = "encryption"
isInstanceBootProfile = "profile"
isInstanceAction = "action"
isInstanceVolumeAttachments = "volume_attachments"
isInstanceVolumeAttaching = "attaching"
isInstanceVolumeAttached = "attached"
isInstanceVolumeDetaching = "detaching"
isInstanceResourceGroup = "resource_group"
isInstanceBootAttachmentName = "name"
isInstanceBootVolumeId = "volume_id"
isInstanceBootSize = "size"
isInstanceBootIOPS = "iops"
isInstanceBootEncryption = "encryption"
isInstanceBootProfile = "profile"
isInstanceAction = "action"
isInstanceVolumeAttachments = "volume_attachments"
isInstanceVolumeAttaching = "attaching"
isInstanceVolumeAttached = "attached"
isInstanceVolumeDetaching = "detaching"
isInstanceResourceGroup = "resource_group"
isInstanceLifecycleReasons = "lifecycle_reasons"
isInstanceLifecycleState = "lifecycle_state"
isInstanceLifecycleReasonsCode = "code"
isInstanceLifecycleReasonsMessage = "message"
isInstanceLifecycleReasonsMoreInfo = "more_info"

isPlacementTargetDedicatedHost = "dedicated_host"
isPlacementTargetDedicatedHostGroup = "dedicated_host_group"
Expand Down Expand Up @@ -722,6 +727,37 @@ func ResourceIBMISInstance() *schema.Resource {
},
},
},
isInstanceLifecycleState: {
Type: schema.TypeString,
Computed: true,
Description: "The lifecycle state of the virtual server instance.",
},
isInstanceLifecycleReasons: {
Type: schema.TypeList,
Computed: true,
Description: "The reasons for the current lifecycle_state (if any).",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
isInstanceLifecycleReasonsCode: {
Type: schema.TypeString,
Computed: true,
Description: "A snake case string succinctly identifying the reason for this lifecycle state.",
},

isInstanceLifecycleReasonsMessage: {
Type: schema.TypeString,
Computed: true,
Description: "An explanation of the reason for this lifecycle state.",
},

isInstanceLifecycleReasonsMoreInfo: {
Type: schema.TypeString,
Computed: true,
Description: "Link to documentation about the reason for this lifecycle state.",
},
},
},
},
isInstanceMetadataServiceEnabled: {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -2394,6 +2430,14 @@ func instanceGet(d *schema.ResourceData, meta interface{}, id string) error {
d.Set(isInstanceStatusReasons, statusReasonsList)
}

//set the lifecycle status, reasons
if instance.LifecycleState != nil {
d.Set(isInstanceLifecycleState, *instance.LifecycleState)
}
if instance.LifecycleReasons != nil {
d.Set(isInstanceLifecycleReasons, dataSourceInstanceFlattenLifecycleReasons(instance.LifecycleReasons))
}

d.Set(isInstanceVPC, *instance.VPC.ID)
d.Set(isInstanceZone, *instance.Zone.Name)

Expand Down
54 changes: 54 additions & 0 deletions ibm/service/vpc/resource_ibm_is_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,60 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
},
})
}
func TestAccIBMISInstance_lifecycle(t *testing.T) {
var instance string
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100))
subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100))
publicKey := strings.TrimSpace(`
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
`)
sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100))
userData1 := "a"
userData2 := "b"

resource.Test(t, resource.TestCase{
PreCheck: func() { acc.TestAccPreCheck(t) },
Providers: acc.TestAccProviders,
CheckDestroy: testAccCheckIBMISInstanceDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckIBMISInstanceConfig(vpcname, subnetname, sshname, publicKey, name, userData1),
Check: resource.ComposeTestCheckFunc(
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "name", name),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "user_data", userData1),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "lifecycle_state", "stable"),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "lifecycle_reasons.#", "0"),
),
},
{
Config: testAccCheckIBMISInstanceConfig(vpcname, subnetname, sshname, publicKey, name, userData2),
Check: resource.ComposeTestCheckFunc(
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "name", name),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "user_data", userData2),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
resource.TestCheckResourceAttrSet(
"ibm_is_instance.testacc_instance", "primary_network_interface.0.port_speed"),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "lifecycle_state", "stable"),
resource.TestCheckResourceAttr(
"ibm_is_instance.testacc_instance", "lifecycle_reasons.#", "0"),
),
},
},
})
}
func TestAccIBMISInstance_rip(t *testing.T) {
var instance string
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
Expand Down
51 changes: 51 additions & 0 deletions ibm/service/vpc/test-fixtures/.ssh/id_rsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKAIBAAKCAgEAugoOuuyDJaLBUM6tw8yzCiq0D0L7NijSr0iwGUBd3o7/xhlQ
JmLyBSeihLEJ18p/sSJX+egXJcd2m+6tBvZZsqbmEttWLvZ60RiQWUnZs3gQiHNf
2nUD+vYZbo6Ht9azrA5uzsdT1OJOqDH2kACGBWnDfH9Pk3j4LYEcL4Timout+Xfw
s1LS9Cr1NU8DSi3qeFVbswcIb9iQw6KMsHpNWPSlyagOgzqVy3iMypcWtvZmKG9p
mT4ktulO1cLyDonbpxt9mIxpblsxzPiSOJQ7ZniDphtwITSKnPV+eLmnA4cLWWZX
wN17cARTkDszL59AMJKBtpqoh6h3Mk1/D1qgR/meSrtxTWC/qcOcx8ylA9rM02eC
0F1PbKDHYMzr8UUwn2mTDJCKv5uC4g2ZUhVJHVbADj8qpFTp1L5hpzGdz23Gg9eu
AYQ2nyvx4jkYIDEAWXxeHoqhRt50p1/nE9o3RyjWBvf/Q4Tgm6hGnm7Re6Fgjt6s
bRn+gs/LiIs0zp9oARusNgBsLkpmH0wImnrVFlTkG2gnyBVtByVeYrxnHYlcZR/d
aaSYV/kw6gP2swJlA35NrUtAF/sjfTakc8GNDwkUQHfWZqjgS/p0GAEMXxbn05u7
DW0Gfq9YqarmO7lVTPRhVjyxeLIz8eBPmlSMoLwLcYEZulF7WZN17UYVRasCAwEA
AQKCAgBNZw/X37109DFgM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NX+4072khdeqwlLaz45u8qSSgXPyFOcyh/GU4OY8B0167LmSqL0X
u72Osx8z/aDrOz66DB5uIwdRUDGg8k0FlbLOu0FoKHVkaxq+rBEjYO92GdDcNiVL
ZBhSlg6gEiSpXZF3x2gZrU0vYnoimo+kV0USbEDjKlgYojPNYRKDKm/jCPx7o1XA
j1LA4cSun4I+yelVd7Eq695uj8FNdQIGboEyRU3sXHleGx//9TZJ6IWJcIUFLUdE
eAyoTLC28WMaCm64rSVYkihsrqTPCfwc89XaOjsPrGKln4zF+gg1KCz2hik=
-----END RSA PRIVATE KEY-----
1 change: 1 addition & 0 deletions ibm/service/vpc/test-fixtures/.ssh/id_rsa.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6Cg667IMlosFQzq3DzLMKKrQPQvs2KNKvSLAZQF3ejv/GGVAmYvIFJ6KEsQnXyn+xIlf56Bclx3ab7q0G9lmypuYS21Yu9nrRGJBZSdmzeBCIc1/adQP69hlujoe31rOsDm7Ox1PU4k6oMfaQAIYFacN8f0+TePgtgRwvhOKai635d/CzUtL0KvU1TwNKLep4VVuzBwhv2JDDooywek1Y9KXJqA6DOpXLeIzKlxa29mYob2mZPiS26U7VwvIOidunG32YjGluWzHM+JI4lDtmeIOmG3AhNIqc9X54uacDhwtZZlfA3XtwBFOQOzMvn0AwkoG2mqiHqHcyTX8PWqBH+Z5Ku3FNYL+pw5zHzKUD2szTZ4LQXU9soMdgzOvxRTCfaZMMkIq/m4LiDZlSFUkdVsAOPyqkVOnUvmGnMZ3PbcaD164BhDafK/HiORggMQBZfF4eiqFG3nSnX+cT2jdHKNYG9/9DhOCbqEaebtF7oWCO3qxtGf6Cz8uIizTOn2gBG6w2AGwuSmYfTAiaetUWVOQbaCfIFW0HJV5ivGcdiVxlH91ppJhX+TDqA/azAmUDfk2tS0AX+yN9NqRzwY0PCRRAd9ZmqOBL+nQYAQxfFufTm7sNbQZ+r1ipquY7uVVM9GFWPLF4sjPx4E+aVIygvAtxgRm6UXtZk3XtRhVFqw==
7 changes: 7 additions & 0 deletions website/docs/d/is_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ In addition to all argument reference list, you can access the following attribu
- `id` - (String) The ID of the SSH key.
- `name` - (String) The name of the SSH key that you entered when you uploaded the key to IBM Cloud.
- `memory`- (Integer) The amount of memory that was allocated to the instance.
- `lifecycle_reasons`- (List) The reasons for the current lifecycle_state (if any).

Nested scheme for `lifecycle_reasons`:
- `code` - (String) A snake case string succinctly identifying the reason for this lifecycle state.
- `message` - (String) An explanation of the reason for this lifecycle state.
- `more_info` - (String) Link to documentation about the reason for this lifecycle state.
- `lifecycle_state`- (String) The lifecycle state of the virtual server instance. [ **deleting**, **failed**, **pending**, **stable**, **suspended**, **updating**, **waiting** ]
- `metadata_service_enabled` - (Boolean) Indicates whether the metadata service endpoint is available to the virtual server instance.
- `network_interfaces`- (List) A list of more network interfaces that the instance uses.

Expand Down
Loading

0 comments on commit 4494a7b

Please sign in to comment.