Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Crn attribute #5107

Merged
merged 19 commits into from Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions ibm/service/power/resource_ibm_pi_workspace.go
Expand Up @@ -8,6 +8,7 @@ import (

st "github.com/IBM-Cloud/power-go-client/clients/instance"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down Expand Up @@ -121,6 +122,11 @@ func resourceIBMPIWorkspaceRead(ctx context.Context, d *schema.ResourceData, met
return diag.FromErr(err)
}
d.Set(PIWorkspaceName, controller.Name)
wsDetails := map[string]interface{}{
Attr_CreationDate: controller.CreatedAt,
Attr_CRN: controller.TargetCRN,
}
d.Set(Attr_WorkspaceDetails, flex.Flatten(wsDetails))
Diptipowervs marked this conversation as resolved.
Show resolved Hide resolved

return nil
}
Expand Down
97 changes: 49 additions & 48 deletions website/docs/r/pi_workspace.html.markdown
@@ -1,49 +1,50 @@
---

subcategory: "Power Systems"
layout: "ibm"
page_title: "IBM: pi_workspace"
description: |-
Manages a workspace in the Power Virtual Server cloud.
---

# ibm_pi_workspace

Create or Delete a PowerVS Workspace

## Example usage

```terraform
data "ibm_resource_group" "group" {
name = "test"
}

resource "ibm_pi_workspace" "powervs_service_instance" {
pi_name = "test-name"
pi_datacenter = "us-east"
pi_resource_group_id = data.ibm_resource_group.group.id
pi_plan = "public"
}
```

## Notes

- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints.
- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows:
- `region` - `lon`
- `zone` - `lon04`

## Argument reference

Review the argument references that you can specify for your resource.

- `pi_name` - (Required, String) A descriptive name used to identify the workspace.
- `pi_datacenter` - (Required, String) Target location or environment to create the resource instance.
- `pi_resource_group_id` - (Required, String) The ID of the resource group where you want to create the workspace. You can retrieve the value from data source `ibm_resource_group`.
- `pi_plan` - (Required, String) Plan associated with the offering; Valid values are `public` or `private`.

## Attribute reference

In addition to all argument reference listed, you can access the following attribute references after your resource source is created.

---

Diptipowervs marked this conversation as resolved.
Show resolved Hide resolved
subcategory: "Power Systems"
layout: "ibm"
page_title: "IBM: pi_workspace"
description: |-
Manages a workspace in the Power Virtual Server cloud.
---

# ibm_pi_workspace

Create or Delete a PowerVS Workspace

## Example usage

```terraform
data "ibm_resource_group" "group" {
name = "test"
}

resource "ibm_pi_workspace" "powervs_service_instance" {
pi_name = "test-name"
pi_datacenter = "us-east"
pi_resource_group_id = data.ibm_resource_group.group.id
pi_plan = "public"
}
```

## Notes

- Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints.
- If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows:
- `region` - `lon`
- `zone` - `lon04`

## Argument reference

Review the argument references that you can specify for your resource.

- `pi_name` - (Required, String) A descriptive name used to identify the workspace.
- `pi_datacenter` - (Required, String) Target location or environment to create the resource instance.
- `pi_resource_group_id` - (Required, String) The ID of the resource group where you want to create the workspace. You can retrieve the value from data source `ibm_resource_group`.
- `pi_plan` - (Required, String) Plan associated with the offering; Valid values are `public` or `private`.
- `crn` - (String) Workspace crn
- `creation_date` -(String) Workspace creation Date
## Attribute reference
Diptipowervs marked this conversation as resolved.
Show resolved Hide resolved

In addition to all argument reference listed, you can access the following attribute references after your resource source is created.

- `id` - (String) Workspace ID.