https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace
Sets up and configures a Power Virtual Servers workspace and optionally connects it to existing transit gateway
https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace
ibm-cloud power powervs powervs-workspace terraform terraform-module
Last synced: about 1 month ago
JSON representation
Sets up and configures a Power Virtual Servers workspace and optionally connects it to existing transit gateway
- Host: GitHub
- URL: https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace
- Owner: terraform-ibm-modules
- License: apache-2.0
- Created: 2023-10-18T10:38:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-12T16:26:37.000Z (about 1 month ago)
- Last Synced: 2025-04-12T21:52:14.227Z (about 1 month ago)
- Topics: ibm-cloud, power, powervs, powervs-workspace, terraform, terraform-module
- Language: HCL
- Size: 432 KB
- Stars: 1
- Watchers: 14
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# PowerVS Workspace
[-brightgreen?style=plastic)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[](https://github.com/semantic-release/semantic-release)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/releases/latest)
[](https://renovatebot.com/)## Summary
This root module automates and provisions a IBM Power Virtual Server Workspace with following components:- Creates an IBM® Power Virtual Server (PowerVS) workspace.
- Creates an SSH key.
- Optionally imports list of stock catalog images.
- Optionally imports up to three custom images from Cloud Object Storage.
- Optionally create one or two or three private subnets.
- Optionally create one public subnet.
- Optionally attach the PowerVS workspace to transit gateway.## Overview
* [terraform-ibm-powervs-workspace](#terraform-ibm-powervs-workspace)
* [Examples](./examples)
* [Basic example](./examples/basic)
* [Contributing](#contributing)## terraform-ibm-powervs-workspace
### Usage
```hcl
provider "ibm" {
region = var.pi_region
zone = var.pi_zone
ibmcloud_api_key = var.ibmcloud_api_key != null ? var.ibmcloud_api_key : null
}module "power-workspace" {
source = "terraform-ibm-modules/powervs-workspace/ibm"
version = "latest" # Replace "latest" with a release version to lock into a specific releasepi_zone = var.pi_zone
pi_resource_group_name = var.pi_resource_group_name
pi_workspace_name = var.pi_workspace_name
pi_ssh_public_key = var.pi_ssh_public_key
pi_image_names = var.pi_image_names
pi_transit_gateway_connection = var.pi_transit_gateway_connection #(optional, default check vars)
pi_private_subnet_1 = var.pi_private_subnet_1 #(optional, default null)
pi_private_subnet_2 = var.pi_private_subnet_2 #(optional, default null)
pi_private_subnet_3 = var.pi_private_subnet_3 #(optional, default null)
pi_public_subnet_enable = var.pi_public_subnet_enable #(optional, default false)
pi_tags = var.pi_tags #(optional, default null)
pi_custom_image1 = var.pi_custom_image1 #(optional, default null)
pi_custom_image2 = var.pi_custom_image2 #(optional, default null)
pi_custom_image3 = var.pi_custom_image3 #(optional, default null)
pi_custom_image_cos_configuration = var.pi_custom_image_cos_configuration #(optional, default null)
pi_custom_image_cos_service_credentials = var.pi_custom_image_cos_service_credentials #(optional, default null)
}```
## Required IAM access policies
You need the following permissions to run this module.
- Account Management
- **Resource Group** service
- `Viewer` platform access
- IAM Services
- **Workspace for Power Virtual Server** service
- **Power Virtual Server** service
- `Editor` platform access
- **VPC Infrastructure Services** service
- `Editor` platform access
- **Transit Gateway** service
- `Editor` platform access
- **Direct Link** service
- `Editor` platform access### Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.9.0 |
| [ibm](#requirement\_ibm) | >=1.71.0 |
| [time](#requirement\_time) | >= 0.9.1 |### Modules
No modules.
### Resources
| Name | Type |
|------|------|
| [ibm_pi_image.import_images](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_image) | resource |
| [ibm_pi_image.pi_custom_image1](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_image) | resource |
| [ibm_pi_image.pi_custom_image2](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_image) | resource |
| [ibm_pi_image.pi_custom_image3](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_image) | resource |
| [ibm_pi_key.ssh_key](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_key) | resource |
| [ibm_pi_network.private_subnet_1](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_network) | resource |
| [ibm_pi_network.private_subnet_2](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_network) | resource |
| [ibm_pi_network.private_subnet_3](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_network) | resource |
| [ibm_pi_network.public_subnet](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_network) | resource |
| [ibm_resource_instance.pi_workspace](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
| [ibm_tg_connection.tg_powervs_workspace_attach](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/tg_connection) | resource |
| [time_sleep.wait_30_sec](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [ibm_pi_catalog_images.catalog_images_ds](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/pi_catalog_images) | data source |
| [ibm_resource_group.resource_group_ds](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/resource_group) | data source |### Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [pi\_custom\_image1](#input\_pi\_custom\_image1) | Optional custom image to import from Cloud Object Storage into PowerVS workspace.
image\_name: string, must be unique image name how the image will be named inside PowerVS workspace
file\_name: string, full file name of the image inside COS bucket
storage\_tier: string, storage tier which the image will be stored in after import. Supported values are: "tier0", "tier1", "tier3", "tier5k".
sap\_type: optional string, "Hana", "Netweaver", don't use it for non-SAP image. |object({| `null` | no |
image_name = string
file_name = string
storage_tier = string
sap_type = optional(string)
})
| [pi\_custom\_image2](#input\_pi\_custom\_image2) | Optional custom image to import from Cloud Object Storage into PowerVS workspace.
image\_name: string, must be unique image name how the image will be named inside PowerVS workspace
file\_name: string, full file name of the image inside COS bucket
storage\_tier: string, storage tier which the image will be stored in after import. Supported values are: "tier0", "tier1", "tier3", "tier5k".
sap\_type: optional string, "Hana", "Netweaver", don't use it for non-SAP image. |object({| `null` | no |
image_name = string
file_name = string
storage_tier = string
sap_type = optional(string)
})
| [pi\_custom\_image3](#input\_pi\_custom\_image3) | Optional custom image to import from Cloud Object Storage into PowerVS workspace.
image\_name: string, must be unique image name how the image will be named inside PowerVS workspace
file\_name: string, full file name of the image inside COS bucket
storage\_tier: string, storage tier which the image will be stored in after import. Supported values are: "tier0", "tier1", "tier3", "tier5k".
sap\_type: optional string, "Hana", "Netweaver", don't use it for non-SAP image. |object({| `null` | no |
image_name = string
file_name = string
storage_tier = string
sap_type = optional(string)
})
| [pi\_custom\_image\_cos\_configuration](#input\_pi\_custom\_image\_cos\_configuration) | Cloud Object Storage bucket containing the custom PowerVS images. Images will be imported into the PowerVS Workspace.
bucket\_name: string, name of the COS bucket
bucket\_access: string, possible values: "public", "private" (private requires pi\_custom\_image\_cos\_service\_credentials)
bucket\_region: string, COS bucket region |object({| `null` | no |
bucket_name = string
bucket_access = string
bucket_region = string
})
| [pi\_custom\_image\_cos\_service\_credentials](#input\_pi\_custom\_image\_cos\_service\_credentials) | Service credentials for the Cloud Object Storage bucket containing the custom PowerVS images. The bucket must have HMAC credentials enabled. Click [here](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-service-credentials) for a json example of a service credential. | `string` | `null` | no |
| [pi\_image\_names](#input\_pi\_image\_names) | List of images to be imported into cloud account from catalog images. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md) | `list(string)` | n/a | yes |
| [pi\_private\_subnet\_1](#input\_pi\_private\_subnet\_1) | IBM Cloud PowerVS first private subnet name and cidr which will be created. Set value to null to not create this subnet. |object({| `null` | no |
name = string
cidr = string
})
| [pi\_private\_subnet\_2](#input\_pi\_private\_subnet\_2) | IBM Cloud PowerVS second private subnet name and cidr which will be created. Set value to null to not create this subnet. |object({| `null` | no |
name = string
cidr = string
})
| [pi\_private\_subnet\_3](#input\_pi\_private\_subnet\_3) | IBM Cloud PowerVS third private subnet name and cidr which will be created. Set value to null to not create this subnet. |object({| `null` | no |
name = string
cidr = string
})
| [pi\_public\_subnet\_enable](#input\_pi\_public\_subnet\_enable) | IBM Cloud PowerVS Public Network. Set to true to enable this. | `bool` | `false` | no |
| [pi\_resource\_group\_name](#input\_pi\_resource\_group\_name) | Existing Resource Group Name. | `string` | n/a | yes |
| [pi\_ssh\_public\_key](#input\_pi\_ssh\_public\_key) | Name and value of the Public SSH key to create in PowerVS workspace. |object({| n/a | yes |
name = string
value = string
})
| [pi\_tags](#input\_pi\_tags) | List of Tag names for IBM Cloud PowerVS workspace. Can be set to null. | `list(string)` | `null` | no |
| [pi\_transit\_gateway\_connection](#input\_pi\_transit\_gateway\_connection) | Set enable to true and provide ID of the existing transit gateway to attach the CCs( Non PER DC) to TGW or to attach PowerVS workspace to TGW (PER DC). If enable is false, CCs will not be attached to TGW , or PowerVS workspace will not be attached to TGW, but CCs in (Non PER DC) will be created. |object({|
enable = bool
transit_gateway_id = string
}){| no |
"enable": false,
"transit_gateway_id": ""
}
| [pi\_workspace\_name](#input\_pi\_workspace\_name) | Name of IBM Cloud PowerVS workspace which will be created. | `string` | n/a | yes |
| [pi\_zone](#input\_pi\_zone) | IBM Cloud PowerVS zone. | `string` | n/a | yes |### Outputs
| Name | Description |
|------|-------------|
| [pi\_images](#output\_pi\_images) | Object containing imported PowerVS image names and image ids. |
| [pi\_private\_subnet\_1](#output\_pi\_private\_subnet\_1) | Created PowerVS private subnet 1 details. |
| [pi\_private\_subnet\_2](#output\_pi\_private\_subnet\_2) | Created PowerVS private subnet 2 details. |
| [pi\_private\_subnet\_3](#output\_pi\_private\_subnet\_3) | Created PowerVS private subnet 3 details. |
| [pi\_public\_subnet](#output\_pi\_public\_subnet) | Created PowerVS public subnet. |
| [pi\_resource\_group\_name](#output\_pi\_resource\_group\_name) | IBM Cloud resource group name tagged to PowerVS Workspace. |
| [pi\_ssh\_public\_key](#output\_pi\_ssh\_public\_key) | SSH public key name and value in created PowerVS infrastructure. |
| [pi\_workspace\_guid](#output\_pi\_workspace\_guid) | PowerVS infrastructure workspace guid. The GUID of the resource instance. |
| [pi\_workspace\_id](#output\_pi\_workspace\_id) | PowerVS infrastructure workspace id. The unique identifier of the new resource instance. |
| [pi\_workspace\_name](#output\_pi\_workspace\_name) | PowerVS infrastructure workspace name. |
| [pi\_zone](#output\_pi\_zone) | Zone where PowerVS infrastructure is created. |## Contributing
You can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).
To set up your local development environment see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation.