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

cloudfoundry.UserProvidedService

Explore with Pulumi AI

cloudfoundry logo
cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community

    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.

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const mq = new cloudfoundry.UserProvidedService("mq", {
        space: cloudfoundry_space.dev.id,
        credentials: {
            url: "mq://localhost:9000",
            username: "admin",
            password: "admin",
        },
    });
    const mail = new cloudfoundry.UserProvidedService("mail", {
        space: cloudfoundry_space.dev.id,
        credentialsJson: `  {
        "server" : {
          "host" : "smtp.example.com",
          "port" : 25,
          "tls"  : false
        },
        "auth" : {
          "user"     : "login",
          "password" : "secret"
        }
      }
    `,
    });
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    mq = cloudfoundry.UserProvidedService("mq",
        space=cloudfoundry_space["dev"]["id"],
        credentials={
            "url": "mq://localhost:9000",
            "username": "admin",
            "password": "admin",
        })
    mail = cloudfoundry.UserProvidedService("mail",
        space=cloudfoundry_space["dev"]["id"],
        credentials_json="""  {
        "server" : {
          "host" : "smtp.example.com",
          "port" : 25,
          "tls"  : false
        },
        "auth" : {
          "user"     : "login",
          "password" : "secret"
        }
      }
    """)
    
    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.NewUserProvidedService(ctx, "mq", &cloudfoundry.UserProvidedServiceArgs{
    			Space: pulumi.Any(cloudfoundry_space.Dev.Id),
    			Credentials: pulumi.StringMap{
    				"url":      pulumi.String("mq://localhost:9000"),
    				"username": pulumi.String("admin"),
    				"password": pulumi.String("admin"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudfoundry.NewUserProvidedService(ctx, "mail", &cloudfoundry.UserProvidedServiceArgs{
    			Space: pulumi.Any(cloudfoundry_space.Dev.Id),
    			CredentialsJson: pulumi.String(`  {
        "server" : {
          "host" : "smtp.example.com",
          "port" : 25,
          "tls"  : false
        },
        "auth" : {
          "user"     : "login",
          "password" : "secret"
        }
      }
    `),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudfoundry = Pulumi.Cloudfoundry;
    
    return await Deployment.RunAsync(() => 
    {
        var mq = new Cloudfoundry.UserProvidedService("mq", new()
        {
            Space = cloudfoundry_space.Dev.Id,
            Credentials = 
            {
                { "url", "mq://localhost:9000" },
                { "username", "admin" },
                { "password", "admin" },
            },
        });
    
        var mail = new Cloudfoundry.UserProvidedService("mail", new()
        {
            Space = cloudfoundry_space.Dev.Id,
            CredentialsJson = @"  {
        ""server"" : {
          ""host"" : ""smtp.example.com"",
          ""port"" : 25,
          ""tls""  : false
        },
        ""auth"" : {
          ""user""     : ""login"",
          ""password"" : ""secret""
        }
      }
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudfoundry.UserProvidedService;
    import com.pulumi.cloudfoundry.UserProvidedServiceArgs;
    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 mq = new UserProvidedService("mq", UserProvidedServiceArgs.builder()
                .space(cloudfoundry_space.dev().id())
                .credentials(Map.ofEntries(
                    Map.entry("url", "mq://localhost:9000"),
                    Map.entry("username", "admin"),
                    Map.entry("password", "admin")
                ))
                .build());
    
            var mail = new UserProvidedService("mail", UserProvidedServiceArgs.builder()
                .space(cloudfoundry_space.dev().id())
                .credentialsJson("""
      {
        "server" : {
          "host" : "smtp.example.com",
          "port" : 25,
          "tls"  : false
        },
        "auth" : {
          "user"     : "login",
          "password" : "secret"
        }
      }
                """)
                .build());
    
        }
    }
    
    resources:
      mq:
        type: cloudfoundry:UserProvidedService
        properties:
          space: ${cloudfoundry_space.dev.id}
          credentials:
            url: mq://localhost:9000
            username: admin
            password: admin
      mail:
        type: cloudfoundry:UserProvidedService
        properties:
          space: ${cloudfoundry_space.dev.id}
          credentialsJson: |2
              {
                "server" : {
                  "host" : "smtp.example.com",
                  "port" : 25,
                  "tls"  : false
                },
                "auth" : {
                  "user"     : "login",
                  "password" : "secret"
                }
              }
    

    Create UserProvidedService Resource

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

    Constructor syntax

    new UserProvidedService(name: string, args: UserProvidedServiceArgs, opts?: CustomResourceOptions);
    @overload
    def UserProvidedService(resource_name: str,
                            args: UserProvidedServiceArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserProvidedService(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            space: Optional[str] = None,
                            credentials: Optional[Mapping[str, str]] = None,
                            credentials_json: Optional[str] = None,
                            name: Optional[str] = None,
                            route_service_url: Optional[str] = None,
                            route_service_url: Optional[str] = None,
                            syslog_drain_url: Optional[str] = None,
                            syslog_drain_url: Optional[str] = None,
                            tags: Optional[Sequence[str]] = None,
                            user_provided_service_id: Optional[str] = None)
    func NewUserProvidedService(ctx *Context, name string, args UserProvidedServiceArgs, opts ...ResourceOption) (*UserProvidedService, error)
    public UserProvidedService(string name, UserProvidedServiceArgs args, CustomResourceOptions? opts = null)
    public UserProvidedService(String name, UserProvidedServiceArgs args)
    public UserProvidedService(String name, UserProvidedServiceArgs args, CustomResourceOptions options)
    
    type: cloudfoundry:UserProvidedService
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args UserProvidedServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UserProvidedServiceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UserProvidedServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserProvidedServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserProvidedServiceArgs
    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 userProvidedServiceResource = new Cloudfoundry.UserProvidedService("userProvidedServiceResource", new()
    {
        Space = "string",
        Credentials = 
        {
            { "string", "string" },
        },
        CredentialsJson = "string",
        Name = "string",
        RouteServiceUrl = "string",
        SyslogDrainUrl = "string",
        Tags = new[]
        {
            "string",
        },
        UserProvidedServiceId = "string",
    });
    
    example, err := cloudfoundry.NewUserProvidedService(ctx, "userProvidedServiceResource", &cloudfoundry.UserProvidedServiceArgs{
    	Space: pulumi.String("string"),
    	Credentials: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	CredentialsJson: pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	RouteServiceUrl: pulumi.String("string"),
    	SyslogDrainUrl:  pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UserProvidedServiceId: pulumi.String("string"),
    })
    
    var userProvidedServiceResource = new UserProvidedService("userProvidedServiceResource", UserProvidedServiceArgs.builder()
        .space("string")
        .credentials(Map.of("string", "string"))
        .credentialsJson("string")
        .name("string")
        .routeServiceUrl("string")
        .syslogDrainUrl("string")
        .tags("string")
        .userProvidedServiceId("string")
        .build());
    
    user_provided_service_resource = cloudfoundry.UserProvidedService("userProvidedServiceResource",
        space="string",
        credentials={
            "string": "string",
        },
        credentials_json="string",
        name="string",
        route_service_url="string",
        syslog_drain_url="string",
        tags=["string"],
        user_provided_service_id="string")
    
    const userProvidedServiceResource = new cloudfoundry.UserProvidedService("userProvidedServiceResource", {
        space: "string",
        credentials: {
            string: "string",
        },
        credentialsJson: "string",
        name: "string",
        routeServiceUrl: "string",
        syslogDrainUrl: "string",
        tags: ["string"],
        userProvidedServiceId: "string",
    });
    
    type: cloudfoundry:UserProvidedService
    properties:
        credentials:
            string: string
        credentialsJson: string
        name: string
        routeServiceUrl: string
        space: string
        syslogDrainUrl: string
        tags:
            - string
        userProvidedServiceId: string
    

    UserProvidedService 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 UserProvidedService resource accepts the following input properties:

    Space string
    The ID of the space
    Credentials Dictionary<string, string>
    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.
    CredentialsJson string
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    Name string
    The name of the Service Instance in Cloud Foundry
    RouteServiceURL string

    Deprecated: Deprecated

    RouteServiceUrl string
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    SyslogDrainURL string

    Deprecated: Deprecated

    SyslogDrainUrl string
    URL to which logs for bound applications will be streamed. Defaults to empty.
    Tags List<string>
    List of tag representing the service
    UserProvidedServiceId string
    The GUID of the service instance
    Space string
    The ID of the space
    Credentials map[string]string
    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.
    CredentialsJson string
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    Name string
    The name of the Service Instance in Cloud Foundry
    RouteServiceURL string

    Deprecated: Deprecated

    RouteServiceUrl string
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    SyslogDrainURL string

    Deprecated: Deprecated

    SyslogDrainUrl string
    URL to which logs for bound applications will be streamed. Defaults to empty.
    Tags []string
    List of tag representing the service
    UserProvidedServiceId string
    The GUID of the service instance
    space String
    The ID of the space
    credentials Map<String,String>
    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.
    credentialsJson String
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name String
    The name of the Service Instance in Cloud Foundry
    routeServiceURL String

    Deprecated: Deprecated

    routeServiceUrl String
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    syslogDrainURL String

    Deprecated: Deprecated

    syslogDrainUrl String
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags List<String>
    List of tag representing the service
    userProvidedServiceId String
    The GUID of the service instance
    space string
    The ID of the space
    credentials {[key: string]: string}
    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.
    credentialsJson string
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name string
    The name of the Service Instance in Cloud Foundry
    routeServiceURL string

    Deprecated: Deprecated

    routeServiceUrl string
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    syslogDrainURL string

    Deprecated: Deprecated

    syslogDrainUrl string
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags string[]
    List of tag representing the service
    userProvidedServiceId string
    The GUID of the service instance
    space str
    The ID of the space
    credentials Mapping[str, str]
    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 str
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name str
    The name of the Service Instance in Cloud Foundry
    route_service_url str

    Deprecated: Deprecated

    route_service_url str
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    syslog_drain_url str

    Deprecated: Deprecated

    syslog_drain_url str
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags Sequence[str]
    List of tag representing the service
    user_provided_service_id str
    The GUID of the service instance
    space String
    The ID of the space
    credentials Map<String>
    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.
    credentialsJson String
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name String
    The name of the Service Instance in Cloud Foundry
    routeServiceURL String

    Deprecated: Deprecated

    routeServiceUrl String
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    syslogDrainURL String

    Deprecated: Deprecated

    syslogDrainUrl String
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags List<String>
    List of tag representing the service
    userProvidedServiceId String
    The GUID of the service instance

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing UserProvidedService Resource

    Get an existing UserProvidedService 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?: UserProvidedServiceState, opts?: CustomResourceOptions): UserProvidedService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            credentials: Optional[Mapping[str, str]] = None,
            credentials_json: Optional[str] = None,
            name: Optional[str] = None,
            route_service_url: Optional[str] = None,
            route_service_url: Optional[str] = None,
            space: Optional[str] = None,
            syslog_drain_url: Optional[str] = None,
            syslog_drain_url: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            user_provided_service_id: Optional[str] = None) -> UserProvidedService
    func GetUserProvidedService(ctx *Context, name string, id IDInput, state *UserProvidedServiceState, opts ...ResourceOption) (*UserProvidedService, error)
    public static UserProvidedService Get(string name, Input<string> id, UserProvidedServiceState? state, CustomResourceOptions? opts = null)
    public static UserProvidedService get(String name, Output<String> id, UserProvidedServiceState state, CustomResourceOptions options)
    resources:  _:    type: cloudfoundry:UserProvidedService    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    Credentials Dictionary<string, string>
    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.
    CredentialsJson string
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    Name string
    The name of the Service Instance in Cloud Foundry
    RouteServiceURL string

    Deprecated: Deprecated

    RouteServiceUrl string
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    Space string
    The ID of the space
    SyslogDrainURL string

    Deprecated: Deprecated

    SyslogDrainUrl string
    URL to which logs for bound applications will be streamed. Defaults to empty.
    Tags List<string>
    List of tag representing the service
    UserProvidedServiceId string
    The GUID of the service instance
    Credentials map[string]string
    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.
    CredentialsJson string
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    Name string
    The name of the Service Instance in Cloud Foundry
    RouteServiceURL string

    Deprecated: Deprecated

    RouteServiceUrl string
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    Space string
    The ID of the space
    SyslogDrainURL string

    Deprecated: Deprecated

    SyslogDrainUrl string
    URL to which logs for bound applications will be streamed. Defaults to empty.
    Tags []string
    List of tag representing the service
    UserProvidedServiceId string
    The GUID of the service instance
    credentials Map<String,String>
    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.
    credentialsJson String
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name String
    The name of the Service Instance in Cloud Foundry
    routeServiceURL String

    Deprecated: Deprecated

    routeServiceUrl String
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    space String
    The ID of the space
    syslogDrainURL String

    Deprecated: Deprecated

    syslogDrainUrl String
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags List<String>
    List of tag representing the service
    userProvidedServiceId String
    The GUID of the service instance
    credentials {[key: string]: string}
    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.
    credentialsJson string
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name string
    The name of the Service Instance in Cloud Foundry
    routeServiceURL string

    Deprecated: Deprecated

    routeServiceUrl string
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    space string
    The ID of the space
    syslogDrainURL string

    Deprecated: Deprecated

    syslogDrainUrl string
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags string[]
    List of tag representing the service
    userProvidedServiceId string
    The GUID of the service instance
    credentials Mapping[str, str]
    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 str
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name str
    The name of the Service Instance in Cloud Foundry
    route_service_url str

    Deprecated: Deprecated

    route_service_url str
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    space str
    The ID of the space
    syslog_drain_url str

    Deprecated: Deprecated

    syslog_drain_url str
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags Sequence[str]
    List of tag representing the service
    user_provided_service_id str
    The GUID of the service instance
    credentials Map<String>
    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.
    credentialsJson String
    Same as credentials but in the form of a stringified JSON object. Conflicts with credentials and defaults to empty map.
    name String
    The name of the Service Instance in Cloud Foundry
    routeServiceURL String

    Deprecated: Deprecated

    routeServiceUrl String
    URL to which requests for bound routes will be forwarded. Scheme for this URL must be https and defaults to empty
    space String
    The ID of the space
    syslogDrainURL String

    Deprecated: Deprecated

    syslogDrainUrl String
    URL to which logs for bound applications will be streamed. Defaults to empty.
    tags List<String>
    List of tag representing the service
    userProvidedServiceId String
    The GUID of the service instance

    Import

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

    bash

    $ pulumi import cloudfoundry:index/userProvidedService:UserProvidedService mq-server a-guid
    

    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.
    cloudfoundry logo
    cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community