Skip to content

resource_user_provided_service

ArthurHlt edited this page Aug 31, 2020 · 3 revisions

cloudfoundry_user_provided_service

Provides a Cloud Foundry resource for managing Cloud Foundry User Provided Services within spaces.

Example Usage

The following is a User Provided Service created within the referenced space.

resource "cloudfoundry_user_provided_service" "mq" {
  name = "mq-server"
  space = cloudfoundry_space.dev.id
  credentials = {
    "url" = "mq://localhost:9000"
    "username" = "admin"
    "password" = "admin"
  }
}

resource "cloudfoundry_user_provided_service" "mail" {
  name = "mail-server"
  space = cloudfoundry_space.dev.id
  credentials_json = <<JSON
  {
    "server" : {
      "host" : "smtp.example.com",
      "port" : 25,
      "tls"  : false
    },
    "auth" : {
      "user"     : "login",
      "password" : "secret"
    }
  }
  JSON
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Service Instance in Cloud Foundry
  • space - (Required) The ID of the space
  • credentials - (Optional) Arbitrary credentials in the form of key-value pairs and delivered to applications via VCAP_SERVICES Env variables. Conflicts with credentials_json and defaults to empty map.
  • credentials_json - (Optional) Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
  • syslog_drain_url - (Optional) URL to which logs for bound applications will be streamed. Defaults to empty.
  • route_service_url - (Optional) URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
  • tags - (optional) List of tag representing the service

Attributes Reference

The following attributes are exported:

  • id - The GUID of the service instance

Import

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

$ terraform import cloudfoundry_user_provided_service.mq-server a-guid
Clone this wiki locally