cloudfoundry.getService
Explore with Pulumi AI
Gets information on a Cloud Foundry service definition.
Example Usage
The following example looks up a service definition named ‘p-redis’, globally.
import * as pulumi from "@pulumi/pulumi";
import * as cloudfoundry from "@pulumi/cloudfoundry";
const redis = cloudfoundry.getService({
name: "p-redis",
});
import pulumi
import pulumi_cloudfoundry as cloudfoundry
redis = cloudfoundry.get_service(name="p-redis")
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.GetService(ctx, &cloudfoundry.GetServiceArgs{
Name: "p-redis",
}, nil)
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 redis = Cloudfoundry.GetService.Invoke(new()
{
Name = "p-redis",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudfoundry.CloudfoundryFunctions;
import com.pulumi.cloudfoundry.inputs.GetServiceArgs;
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) {
final var redis = CloudfoundryFunctions.getService(GetServiceArgs.builder()
.name("p-redis")
.build());
}
}
variables:
redis:
fn::invoke:
function: cloudfoundry:getService
arguments:
name: p-redis
The following example looks up a service named ‘p-redis’, registered as a space-scoped service within the specified Space id
import * as pulumi from "@pulumi/pulumi";
import * as cloudfoundry from "@pulumi/cloudfoundry";
const redis = cloudfoundry.getService({
name: "p-redis",
space: cloudfoundry_space.dev.id,
});
import pulumi
import pulumi_cloudfoundry as cloudfoundry
redis = cloudfoundry.get_service(name="p-redis",
space=cloudfoundry_space["dev"]["id"])
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.GetService(ctx, &cloudfoundry.GetServiceArgs{
Name: "p-redis",
Space: pulumi.StringRef(cloudfoundry_space.Dev.Id),
}, nil)
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 redis = Cloudfoundry.GetService.Invoke(new()
{
Name = "p-redis",
Space = cloudfoundry_space.Dev.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudfoundry.CloudfoundryFunctions;
import com.pulumi.cloudfoundry.inputs.GetServiceArgs;
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) {
final var redis = CloudfoundryFunctions.getService(GetServiceArgs.builder()
.name("p-redis")
.space(cloudfoundry_space.dev().id())
.build());
}
}
variables:
redis:
fn::invoke:
function: cloudfoundry:getService
arguments:
name: p-redis
space: ${cloudfoundry_space.dev.id}
The following example looks up a service named ‘p-redis’, registered as a space-scoped service within the specified Space id provided by a specific service broker (its guid is hardcoded here because service brokers are not always visible to non admin users of cloud foundry).
import * as pulumi from "@pulumi/pulumi";
import * as cloudfoundry from "@pulumi/cloudfoundry";
const redis = cloudfoundry.getService({
name: "p-redis",
space: cloudfoundry_space.dev.id,
serviceBrokerGuid: "5716f06c-b3a2-4e8a-893f-39870b0c9f42",
});
import pulumi
import pulumi_cloudfoundry as cloudfoundry
redis = cloudfoundry.get_service(name="p-redis",
space=cloudfoundry_space["dev"]["id"],
service_broker_guid="5716f06c-b3a2-4e8a-893f-39870b0c9f42")
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.GetService(ctx, &cloudfoundry.GetServiceArgs{
Name: "p-redis",
Space: pulumi.StringRef(cloudfoundry_space.Dev.Id),
ServiceBrokerGuid: pulumi.StringRef("5716f06c-b3a2-4e8a-893f-39870b0c9f42"),
}, nil)
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 redis = Cloudfoundry.GetService.Invoke(new()
{
Name = "p-redis",
Space = cloudfoundry_space.Dev.Id,
ServiceBrokerGuid = "5716f06c-b3a2-4e8a-893f-39870b0c9f42",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudfoundry.CloudfoundryFunctions;
import com.pulumi.cloudfoundry.inputs.GetServiceArgs;
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) {
final var redis = CloudfoundryFunctions.getService(GetServiceArgs.builder()
.name("p-redis")
.space(cloudfoundry_space.dev().id())
.serviceBrokerGuid("5716f06c-b3a2-4e8a-893f-39870b0c9f42")
.build());
}
}
variables:
redis:
fn::invoke:
function: cloudfoundry:getService
arguments:
name: p-redis
space: ${cloudfoundry_space.dev.id}
serviceBrokerGuid: 5716f06c-b3a2-4e8a-893f-39870b0c9f42
Using getService
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
def get_service(id: Optional[str] = None,
name: Optional[str] = None,
service_broker_guid: Optional[str] = None,
space: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
service_broker_guid: Optional[pulumi.Input[str]] = None,
space: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
func GetService(ctx *Context, args *GetServiceArgs, opts ...InvokeOption) (*GetServiceResult, error)
func GetServiceOutput(ctx *Context, args *GetServiceOutputArgs, opts ...InvokeOption) GetServiceResultOutput
> Note: This function is named GetService
in the Go SDK.
public static class GetService
{
public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
public static Output<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
fn::invoke:
function: cloudfoundry:index/getService:getService
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of the service to look up
- Id string
- The GUID of the service
- Service
Broker stringGuid - The guid of the service broker which offers the service. You can use this to filter two equally named services from different brokers.
- Space string
- The space within which the service is defined (as a space-scoped service)
- Name string
- The name of the service to look up
- Id string
- The GUID of the service
- Service
Broker stringGuid - The guid of the service broker which offers the service. You can use this to filter two equally named services from different brokers.
- Space string
- The space within which the service is defined (as a space-scoped service)
- name String
- The name of the service to look up
- id String
- The GUID of the service
- service
Broker StringGuid - The guid of the service broker which offers the service. You can use this to filter two equally named services from different brokers.
- space String
- The space within which the service is defined (as a space-scoped service)
- name string
- The name of the service to look up
- id string
- The GUID of the service
- service
Broker stringGuid - The guid of the service broker which offers the service. You can use this to filter two equally named services from different brokers.
- space string
- The space within which the service is defined (as a space-scoped service)
- name str
- The name of the service to look up
- id str
- The GUID of the service
- service_
broker_ strguid - The guid of the service broker which offers the service. You can use this to filter two equally named services from different brokers.
- space str
- The space within which the service is defined (as a space-scoped service)
- name String
- The name of the service to look up
- id String
- The GUID of the service
- service
Broker StringGuid - The guid of the service broker which offers the service. You can use this to filter two equally named services from different brokers.
- space String
- The space within which the service is defined (as a space-scoped service)
getService Result
The following output properties are available:
- Id string
- The GUID of the service
- Name string
- Service
Broker stringName - The name of the service broker that offers the service.
- Service
Plans Dictionary<string, string> - Map of service plan GUIDs keyed by service "<service name>/<plan name>"
- Service
Broker stringGuid - Space string
- Id string
- The GUID of the service
- Name string
- Service
Broker stringName - The name of the service broker that offers the service.
- Service
Plans map[string]string - Map of service plan GUIDs keyed by service "<service name>/<plan name>"
- Service
Broker stringGuid - Space string
- id String
- The GUID of the service
- name String
- service
Broker StringName - The name of the service broker that offers the service.
- service
Plans Map<String,String> - Map of service plan GUIDs keyed by service "<service name>/<plan name>"
- service
Broker StringGuid - space String
- id string
- The GUID of the service
- name string
- service
Broker stringName - The name of the service broker that offers the service.
- service
Plans {[key: string]: string} - Map of service plan GUIDs keyed by service "<service name>/<plan name>"
- service
Broker stringGuid - space string
- id str
- The GUID of the service
- name str
- service_
broker_ strname - The name of the service broker that offers the service.
- service_
plans Mapping[str, str] - Map of service plan GUIDs keyed by service "<service name>/<plan name>"
- service_
broker_ strguid - space str
- id String
- The GUID of the service
- name String
- service
Broker StringName - The name of the service broker that offers the service.
- service
Plans Map<String> - Map of service plan GUIDs keyed by service "<service name>/<plan name>"
- service
Broker StringGuid - space String
Package Details
- Repository
- cloudfoundry cloudfoundry-community/terraform-provider-cloudfoundry
- License
- Notes
- This Pulumi package is based on the
cloudfoundry
Terraform Provider.