Terraform IBM - iam_role_crn for service instance alias

55 views Asked by At

I am trying to provision some IBM Watson Assistant services using the terraform provider for IBM. I am currently using the ibm_service_instance along with ibm_service_key resources from the IBM provider. The relevant piece of terraform code can be found below.

# create service
resource "ibm_service_instance" "wa_test_service_instance_name" {
  count = var.wa_template_service_counter
  name = "Test-${var.wa_test_service_instance_name}-${var.app_name}-${count.index + 1}"
  space_guid = var.space_guid
  service = var.service_offering
  plan = var.plan
}

# create credentials
resource "ibm_service_key" "wa_test_service_key" {
  count = var.wa_template_service_counter
  name = var.service_key_name
  service_instance_guid = ibm_service_instance.wa_test_service_instance_name[count.index].id
  depends_on = [ibm_service_instance.wa_test_service_instance_name]
}

The service instance is created successfully along with the credentials and the CF alias. The problem is that for the CF alias, the created credentials are not having iam_role_crn manager which is the required setup in my configuration. enter image description here

If I manually add the credentials from IBM cloud dashboard for the CF alias, they are created with the iam_role_crn Manager. Also, the resource instance for which is this alias has in its credentials iam_role_crn = Manager.

I could not find a way of specifying such a parameter when the ibm_service_key or ibm_service_instance gets created. https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/service_key

Is there a way to create the credentials for the alias of the service with this parameter iam_role_crn setup as Manager or is there a work-around to achieve this?

0

There are 0 answers