Skip to content

Sets up and configures a Power Virtual Servers workspace and optionally connects it to existing transit gateway

License

Notifications You must be signed in to change notification settings

terraform-ibm-modules/terraform-ibm-powervs-workspace

Repository files navigation

PowerVS Workspace

Graduated (Supported) semantic-release pre-commit latest release Renovate enabled

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.
  • Imports list of stock catalog images.
  • 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

Usage

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 release

  pi_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 [])
}

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 >= 1.3
ibm >=1.65.0
time >= 0.9.1

Modules

No modules.

Resources

Name Type
ibm_pi_image.import_images resource
ibm_pi_key.ssh_key resource
ibm_pi_network.private_subnet_1 resource
ibm_pi_network.private_subnet_2 resource
ibm_pi_network.private_subnet_3 resource
ibm_pi_network.public_subnet resource
ibm_resource_instance.pi_workspace resource
ibm_tg_connection.tg_powervs_workspace_attach resource
time_sleep.wait_30_sec resource
ibm_pi_catalog_images.catalog_images_ds data source
ibm_resource_group.resource_group_ds data source

Inputs

Name Description Type Default Required
pi_image_names List of images to be imported into cloud account from catalog images. Supported values can be found here list(string) n/a yes
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({
name = string
cidr = string
})
null no
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({
name = string
cidr = string
})
null no
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({
name = string
cidr = string
})
null no
pi_public_subnet_enable IBM Cloud PowerVS Public Network. Set to true to enable this. bool false no
pi_resource_group_name Existing Resource Group Name. string n/a yes
pi_ssh_public_key Name and value of the Public SSH key to create in PowerVS workspace.
object({
name = string
value = string
})
n/a yes
pi_tags List of Tag names for IBM Cloud PowerVS workspace. Can be set to null. list(string) null no
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
})
{
"enable": false,
"transit_gateway_id": ""
}
no
pi_workspace_name Name of IBM Cloud PowerVS workspace which will be created. string n/a yes
pi_zone IBM Cloud PowerVS zone. string n/a yes

Outputs

Name Description
pi_images Object containing imported PowerVS image names and image ids.
pi_private_subnet_1 Created PowerVS private subnet 1 details.
pi_private_subnet_2 Created PowerVS private subnet 2 details.
pi_private_subnet_3 Created PowerVS private subnet 3 details.
pi_public_subnet Created PowerVS public subnet.
pi_resource_group_name IBM Cloud resource group name tagged to PowerVS Workspace.
pi_ssh_public_key SSH public key name and value in created PowerVS infrastructure.
pi_workspace_guid PowerVS infrastructure workspace guid. The GUID of the resource instance.
pi_workspace_id PowerVS infrastructure workspace id. The unique identifier of the new resource instance.
pi_workspace_name PowerVS infrastructure workspace name.
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.

To set up your local development environment see Local development setup in the project documentation.