Skip to content

resource_service_key

ArthurHlt edited this page Aug 31, 2020 · 3 revisions

cloudfoundry_service_key

Provides a Cloud Foundry resource for managing Cloud Foundry Service Keys.

Example Usage

The following creates a Service Key for the referenced Service Instance.

data "cloudfoundry_service" "redis" {
    name = "p-redis"
}

resource "cloudfoundry_service_instance" "redis1" {
  name = "pricing-grid"
  space = cloudfoundry_space.dev.id
  service_plan = data.cloudfoundry_service.redis.service_plans["shared-vm"]
}

resource "cloudfoundry_service_key" "redis1-key1" {
  name = "pricing-grid-key1"
  service_instance = cloudfoundry_service_instance.redis.id
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Service Key in Cloud Foundry.
  • service_instance - (Required) The ID of the Service Instance the key should be associated with.
  • params - (Optional, Map) A list of key/value parameters used by the service broker to create the binding for the key. By default, no parameters are provided.
  • json_params - (Optional, String) Arbitrary parameters in the form of stringified JSON object to pass to the service bind handler.

Attributes Reference

The following attributes are exported:

  • id - The GUID of the service instance.
  • credentials - Credentials for this service key that can be used to bind to the associated service instance.

Import

An existing Service Key can be imported using its guid , e.g.

$ terraform import cloudfoundry_service_key.redis1-key1 a-guid
Clone this wiki locally