Skip to content

Commit

Permalink
Set cloud instance ID and host group ID in host, update docs with import
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Kita committed Nov 16, 2024
1 parent 8780a5c commit 7a8cab2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ibm/service/power/resource_ibm_pi_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ func resourceIBMPIHostRead(ctx context.Context, d *schema.ResourceData, meta int
}
return diag.FromErr(err)
}
d.Set(Arg_CloudInstanceID, cloudInstanceID)
hostGroupID, err := getLastPart(host.HostGroup.Href)
if err != nil {
return diag.FromErr(err)
}
d.Set(Arg_HostGroupID, hostGroupID)
d.Set(Attr_HostID, host.ID)

if host.Capacity != nil {
Expand Down
10 changes: 10 additions & 0 deletions website/docs/r/pi_host.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,13 @@ In addition to all argument reference list, you can access the following attribu
- `status` - (String) Status of the host `enabled` or `disabled`.
- `sys_type` - (String) System type.
- `user_tags` - (List) The user tags attached to this resource.

## Import

The `ibm_pi_host` resource can be imported by using `pi_cloud_instance_id` and `host_id`.

### Example

```bash
terraform import ibm_pi_host.example d7bec597-4726-451f-8a63-e62e6f19c32c/b17a2b7f-77ab-491c-811e-495f8d4c8947
```

0 comments on commit 7a8cab2

Please sign in to comment.