1. Packages
  2. Cloudfoundry Provider
  3. API Docs
  4. ServiceBroker
cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community

cloudfoundry.ServiceBroker

Explore with Pulumi AI

Example Usage

The following example registers a service broker.

import * as pulumi from "@pulumi/pulumi";
import * as cloudfoundry from "@pulumi/cloudfoundry";

const mysql = new cloudfoundry.ServiceBroker("mysql", {
    password: "admin",
    url: "http://mysql-broker.local.pcfdev.io",
    username: "admin",
});
Copy
import pulumi
import pulumi_cloudfoundry as cloudfoundry

mysql = cloudfoundry.ServiceBroker("mysql",
    password="admin",
    url="http://mysql-broker.local.pcfdev.io",
    username="admin")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cloudfoundry/cloudfoundry"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfoundry.NewServiceBroker(ctx, "mysql", &cloudfoundry.ServiceBrokerArgs{
			Password: pulumi.String("admin"),
			Url:      pulumi.String("http://mysql-broker.local.pcfdev.io"),
			Username: pulumi.String("admin"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudfoundry = Pulumi.Cloudfoundry;

return await Deployment.RunAsync(() => 
{
    var mysql = new Cloudfoundry.ServiceBroker("mysql", new()
    {
        Password = "admin",
        Url = "http://mysql-broker.local.pcfdev.io",
        Username = "admin",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudfoundry.ServiceBroker;
import com.pulumi.cloudfoundry.ServiceBrokerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var mysql = new ServiceBroker("mysql", ServiceBrokerArgs.builder()
            .password("admin")
            .url("http://mysql-broker.local.pcfdev.io")
            .username("admin")
            .build());

    }
}
Copy
resources:
  mysql:
    type: cloudfoundry:ServiceBroker
    properties:
      password: admin
      url: http://mysql-broker.local.pcfdev.io
      username: admin
Copy

Create ServiceBroker Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServiceBroker(name: string, args: ServiceBrokerArgs, opts?: CustomResourceOptions);
@overload
def ServiceBroker(resource_name: str,
                  args: ServiceBrokerArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def ServiceBroker(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  password: Optional[str] = None,
                  url: Optional[str] = None,
                  username: Optional[str] = None,
                  annotations: Optional[Mapping[str, str]] = None,
                  catalog_change: Optional[bool] = None,
                  catalog_hash: Optional[str] = None,
                  fail_when_catalog_not_accessible: Optional[bool] = None,
                  labels: Optional[Mapping[str, str]] = None,
                  name: Optional[str] = None,
                  service_broker_id: Optional[str] = None,
                  space: Optional[str] = None)
func NewServiceBroker(ctx *Context, name string, args ServiceBrokerArgs, opts ...ResourceOption) (*ServiceBroker, error)
public ServiceBroker(string name, ServiceBrokerArgs args, CustomResourceOptions? opts = null)
public ServiceBroker(String name, ServiceBrokerArgs args)
public ServiceBroker(String name, ServiceBrokerArgs args, CustomResourceOptions options)
type: cloudfoundry:ServiceBroker
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServiceBrokerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServiceBrokerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceBrokerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceBrokerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServiceBrokerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var serviceBrokerResource = new Cloudfoundry.ServiceBroker("serviceBrokerResource", new()
{
    Password = "string",
    Url = "string",
    Username = "string",
    Annotations = 
    {
        { "string", "string" },
    },
    CatalogChange = false,
    CatalogHash = "string",
    FailWhenCatalogNotAccessible = false,
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    ServiceBrokerId = "string",
    Space = "string",
});
Copy
example, err := cloudfoundry.NewServiceBroker(ctx, "serviceBrokerResource", &cloudfoundry.ServiceBrokerArgs{
Password: pulumi.String("string"),
Url: pulumi.String("string"),
Username: pulumi.String("string"),
Annotations: pulumi.StringMap{
"string": pulumi.String("string"),
},
CatalogChange: pulumi.Bool(false),
CatalogHash: pulumi.String("string"),
FailWhenCatalogNotAccessible: pulumi.Bool(false),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
ServiceBrokerId: pulumi.String("string"),
Space: pulumi.String("string"),
})
Copy
var serviceBrokerResource = new ServiceBroker("serviceBrokerResource", ServiceBrokerArgs.builder()
    .password("string")
    .url("string")
    .username("string")
    .annotations(Map.of("string", "string"))
    .catalogChange(false)
    .catalogHash("string")
    .failWhenCatalogNotAccessible(false)
    .labels(Map.of("string", "string"))
    .name("string")
    .serviceBrokerId("string")
    .space("string")
    .build());
Copy
service_broker_resource = cloudfoundry.ServiceBroker("serviceBrokerResource",
    password="string",
    url="string",
    username="string",
    annotations={
        "string": "string",
    },
    catalog_change=False,
    catalog_hash="string",
    fail_when_catalog_not_accessible=False,
    labels={
        "string": "string",
    },
    name="string",
    service_broker_id="string",
    space="string")
Copy
const serviceBrokerResource = new cloudfoundry.ServiceBroker("serviceBrokerResource", {
    password: "string",
    url: "string",
    username: "string",
    annotations: {
        string: "string",
    },
    catalogChange: false,
    catalogHash: "string",
    failWhenCatalogNotAccessible: false,
    labels: {
        string: "string",
    },
    name: "string",
    serviceBrokerId: "string",
    space: "string",
});
Copy
type: cloudfoundry:ServiceBroker
properties:
    annotations:
        string: string
    catalogChange: false
    catalogHash: string
    failWhenCatalogNotAccessible: false
    labels:
        string: string
    name: string
    password: string
    serviceBrokerId: string
    space: string
    url: string
    username: string
Copy

ServiceBroker Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServiceBroker resource accepts the following input properties:

Password This property is required. string
The password to authenticate against the service broker API calls
Url This property is required. string
The URL to the service broker API
Username This property is required. string
The user name to use to authenticate against the service broker API calls
Annotations Dictionary<string, string>
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
CatalogChange bool
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
CatalogHash string
FailWhenCatalogNotAccessible bool
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
Labels Dictionary<string, string>
Add labels as described here. Works only on cloud foundry with api >= v3.71.
Name string
The name of the service broker
ServiceBrokerId string
The GUID of the service broker
Space string
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
Password This property is required. string
The password to authenticate against the service broker API calls
Url This property is required. string
The URL to the service broker API
Username This property is required. string
The user name to use to authenticate against the service broker API calls
Annotations map[string]string
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
CatalogChange bool
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
CatalogHash string
FailWhenCatalogNotAccessible bool
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
Labels map[string]string
Add labels as described here. Works only on cloud foundry with api >= v3.71.
Name string
The name of the service broker
ServiceBrokerId string
The GUID of the service broker
Space string
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
password This property is required. String
The password to authenticate against the service broker API calls
url This property is required. String
The URL to the service broker API
username This property is required. String
The user name to use to authenticate against the service broker API calls
annotations Map<String,String>
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalogChange Boolean
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalogHash String
failWhenCatalogNotAccessible Boolean
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels Map<String,String>
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name String
The name of the service broker
serviceBrokerId String
The GUID of the service broker
space String
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
password This property is required. string
The password to authenticate against the service broker API calls
url This property is required. string
The URL to the service broker API
username This property is required. string
The user name to use to authenticate against the service broker API calls
annotations {[key: string]: string}
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalogChange boolean
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalogHash string
failWhenCatalogNotAccessible boolean
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels {[key: string]: string}
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name string
The name of the service broker
serviceBrokerId string
The GUID of the service broker
space string
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
password This property is required. str
The password to authenticate against the service broker API calls
url This property is required. str
The URL to the service broker API
username This property is required. str
The user name to use to authenticate against the service broker API calls
annotations Mapping[str, str]
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalog_change bool
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalog_hash str
fail_when_catalog_not_accessible bool
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels Mapping[str, str]
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name str
The name of the service broker
service_broker_id str
The GUID of the service broker
space str
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
password This property is required. String
The password to authenticate against the service broker API calls
url This property is required. String
The URL to the service broker API
username This property is required. String
The user name to use to authenticate against the service broker API calls
annotations Map<String>
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalogChange Boolean
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalogHash String
failWhenCatalogNotAccessible Boolean
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels Map<String>
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name String
The name of the service broker
serviceBrokerId String
The GUID of the service broker
space String
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceBroker resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
ServicePlans Dictionary<string, string>
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
Services Dictionary<string, string>
Map of service GUIDs keyed by service name
Id string
The provider-assigned unique ID for this managed resource.
ServicePlans map[string]string
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
Services map[string]string
Map of service GUIDs keyed by service name
id String
The provider-assigned unique ID for this managed resource.
servicePlans Map<String,String>
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services Map<String,String>
Map of service GUIDs keyed by service name
id string
The provider-assigned unique ID for this managed resource.
servicePlans {[key: string]: string}
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services {[key: string]: string}
Map of service GUIDs keyed by service name
id str
The provider-assigned unique ID for this managed resource.
service_plans Mapping[str, str]
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services Mapping[str, str]
Map of service GUIDs keyed by service name
id String
The provider-assigned unique ID for this managed resource.
servicePlans Map<String>
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services Map<String>
Map of service GUIDs keyed by service name

Look up Existing ServiceBroker Resource

Get an existing ServiceBroker resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ServiceBrokerState, opts?: CustomResourceOptions): ServiceBroker
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        annotations: Optional[Mapping[str, str]] = None,
        catalog_change: Optional[bool] = None,
        catalog_hash: Optional[str] = None,
        fail_when_catalog_not_accessible: Optional[bool] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        service_broker_id: Optional[str] = None,
        service_plans: Optional[Mapping[str, str]] = None,
        services: Optional[Mapping[str, str]] = None,
        space: Optional[str] = None,
        url: Optional[str] = None,
        username: Optional[str] = None) -> ServiceBroker
func GetServiceBroker(ctx *Context, name string, id IDInput, state *ServiceBrokerState, opts ...ResourceOption) (*ServiceBroker, error)
public static ServiceBroker Get(string name, Input<string> id, ServiceBrokerState? state, CustomResourceOptions? opts = null)
public static ServiceBroker get(String name, Output<String> id, ServiceBrokerState state, CustomResourceOptions options)
resources:  _:    type: cloudfoundry:ServiceBroker    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Annotations Dictionary<string, string>
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
CatalogChange bool
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
CatalogHash string
FailWhenCatalogNotAccessible bool
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
Labels Dictionary<string, string>
Add labels as described here. Works only on cloud foundry with api >= v3.71.
Name string
The name of the service broker
Password string
The password to authenticate against the service broker API calls
ServiceBrokerId string
The GUID of the service broker
ServicePlans Dictionary<string, string>
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
Services Dictionary<string, string>
Map of service GUIDs keyed by service name
Space string
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
Url string
The URL to the service broker API
Username string
The user name to use to authenticate against the service broker API calls
Annotations map[string]string
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
CatalogChange bool
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
CatalogHash string
FailWhenCatalogNotAccessible bool
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
Labels map[string]string
Add labels as described here. Works only on cloud foundry with api >= v3.71.
Name string
The name of the service broker
Password string
The password to authenticate against the service broker API calls
ServiceBrokerId string
The GUID of the service broker
ServicePlans map[string]string
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
Services map[string]string
Map of service GUIDs keyed by service name
Space string
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
Url string
The URL to the service broker API
Username string
The user name to use to authenticate against the service broker API calls
annotations Map<String,String>
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalogChange Boolean
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalogHash String
failWhenCatalogNotAccessible Boolean
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels Map<String,String>
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name String
The name of the service broker
password String
The password to authenticate against the service broker API calls
serviceBrokerId String
The GUID of the service broker
servicePlans Map<String,String>
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services Map<String,String>
Map of service GUIDs keyed by service name
space String
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
url String
The URL to the service broker API
username String
The user name to use to authenticate against the service broker API calls
annotations {[key: string]: string}
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalogChange boolean
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalogHash string
failWhenCatalogNotAccessible boolean
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels {[key: string]: string}
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name string
The name of the service broker
password string
The password to authenticate against the service broker API calls
serviceBrokerId string
The GUID of the service broker
servicePlans {[key: string]: string}
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services {[key: string]: string}
Map of service GUIDs keyed by service name
space string
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
url string
The URL to the service broker API
username string
The user name to use to authenticate against the service broker API calls
annotations Mapping[str, str]
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalog_change bool
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalog_hash str
fail_when_catalog_not_accessible bool
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels Mapping[str, str]
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name str
The name of the service broker
password str
The password to authenticate against the service broker API calls
service_broker_id str
The GUID of the service broker
service_plans Mapping[str, str]
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services Mapping[str, str]
Map of service GUIDs keyed by service name
space str
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
url str
The URL to the service broker API
username str
The user name to use to authenticate against the service broker API calls
annotations Map<String>
Add annotations as described here. Works only on cloud foundry with api >= v3.71.
catalogChange Boolean
Special marker to know and trigger a service broker update, this should not be set to true on your resource declaration
catalogHash String
failWhenCatalogNotAccessible Boolean
Set to true if you want to see errors when getting service broker catalog (default behaviour is silently failed).
labels Map<String>
Add labels as described here. Works only on cloud foundry with api >= v3.71.
name String
The name of the service broker
password String
The password to authenticate against the service broker API calls
serviceBrokerId String
The GUID of the service broker
servicePlans Map<String>
Map of service plan GUIDs keyed by service "<service name>/<plan name>"
services Map<String>
Map of service GUIDs keyed by service name
space String
The ID of the space to scope this broker to (registering the broker as space-scoped). By default, registers standard brokers
url String
The URL to the service broker API
username String
The user name to use to authenticate against the service broker API calls

Import

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

bash

$ pulumi import cloudfoundry:index/serviceBroker:ServiceBroker mysql a-guid
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
cloudfoundry cloudfoundry-community/terraform-provider-cloudfoundry
License
Notes
This Pulumi package is based on the cloudfoundry Terraform Provider.