IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

ibm_pi_workspace - add crn return attribute to work with ibm_tg_connection #5061

Closed powellquiring closed 6 months ago

powellquiring commented 9 months ago

Community Note

Description

Add crn return attribute to ibm_pi_workspace. The crn is required to work with a transit gateway.

New or Affected Resource(s)

Potential Terraform Configuration

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/pi_workspace

Specifies the attributes containing just the id:

image

The crn of the workspace is needed for a transit gateway connection:

resource "ibm_tg_connection" "spokes_power" {
  // this could be indexed by spoke number but currently 0 based
  for_each     = { for spoke_number, power in module.spokes_power : spoke_number => power.power }
  network_type = "power_virtual_server"
  gateway      = local.tg_gateway.id
  name         = each.value.name
  network_id   = each.value.crn
}
michaelkad commented 9 months ago

@powellquiring I would suggest using https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance to access that in the meantime. We are looking into this.

powellquiring commented 9 months ago

Good point:

/*
resource "ibm_pi_workspace" "location" {
  pi_name              = local.name
  pi_datacenter        = local.datacenter
  pi_resource_group_id = local.resource_group_id
  # pi_plan              = "power-virtual-server-group"
  pi_plan = "public"
}
*/

resource "ibm_resource_instance" "location" {
  name              = local.name
  resource_group_id = local.resource_group_id
  location          = local.datacenter
  service           = "power-iaas"
  plan              = "power-virtual-server-group"
}
yussufsh commented 6 months ago

ibm_pi_workspace.crn is available to use now.