1. Registry
  2. Packages
  3. Cloudfoundry Provider
  4. API Docs
  5. getSpaceRoles
Viewing docs for cloudfoundry 1.18.0
published on Monday, Nov 2, 2026 by cloudfoundry
cloudfoundry
Viewing docs for cloudfoundry 1.18.0
published on Monday, Nov 2, 2026 by cloudfoundry

    Gets information on Cloud Foundry roles within a space.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const roles = cloudfoundry.getSpaceRoles({
        space: "02c0cc92-6ecc-44b1-b7b2-096ca19ee143",
    });
    export const roleObjects = roles;
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    roles = cloudfoundry.get_space_roles(space="02c0cc92-6ecc-44b1-b7b2-096ca19ee143")
    pulumi.export("roleObjects", roles)
    
    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 {
    		roles, err := cloudfoundry.GetSpaceRoles(ctx, &cloudfoundry.GetSpaceRolesArgs{
    			Space: "02c0cc92-6ecc-44b1-b7b2-096ca19ee143",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("roleObjects", roles)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudfoundry = Pulumi.Cloudfoundry;
    
    return await Deployment.RunAsync(() => 
    {
        var roles = Cloudfoundry.GetSpaceRoles.Invoke(new()
        {
            Space = "02c0cc92-6ecc-44b1-b7b2-096ca19ee143",
        });
    
        return new Dictionary<string, object?>
        {
            ["roleObjects"] = roles,
        };
    });
    
    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.GetSpaceRolesArgs;
    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 roles = CloudfoundryFunctions.getSpaceRoles(GetSpaceRolesArgs.builder()
                .space("02c0cc92-6ecc-44b1-b7b2-096ca19ee143")
                .build());
    
            ctx.export("roleObjects", roles);
        }
    }
    
    variables:
      roles:
        fn::invoke:
          function: cloudfoundry:getSpaceRoles
          arguments:
            space: 02c0cc92-6ecc-44b1-b7b2-096ca19ee143
    outputs:
      roleObjects: ${roles}
    
    Example coming soon!
    

    Using getSpaceRoles

    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 getSpaceRoles(args: GetSpaceRolesArgs, opts?: InvokeOptions): Promise<GetSpaceRolesResult>
    function getSpaceRolesOutput(args: GetSpaceRolesOutputArgs, opts?: InvokeOutputOptions): Output<GetSpaceRolesResult>
    def get_space_roles(space: Optional[str] = None,
                        type: Optional[str] = None,
                        user: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetSpaceRolesResult
    def get_space_roles_output(space: pulumi.Input[Optional[str]] = None,
                        type: pulumi.Input[Optional[str]] = None,
                        user: pulumi.Input[Optional[str]] = None,
                        opts: Optional[InvokeOutputOptions] = None) -> Output[GetSpaceRolesResult]
    func GetSpaceRoles(ctx *Context, args *GetSpaceRolesArgs, opts ...InvokeOption) (*GetSpaceRolesResult, error)
    func GetSpaceRolesOutput(ctx *Context, args *GetSpaceRolesOutputArgs, opts ...InvokeOption) GetSpaceRolesResultOutput

    > Note: This function is named GetSpaceRoles in the Go SDK.

    public static class GetSpaceRoles 
    {
        public static Task<GetSpaceRolesResult> InvokeAsync(GetSpaceRolesArgs args, InvokeOptions? opts = null)
        public static Output<GetSpaceRolesResult> Invoke(GetSpaceRolesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetSpaceRolesResult> Invoke(GetSpaceRolesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetSpaceRolesResult> getSpaceRoles(GetSpaceRolesArgs args, InvokeOptions options)
    public static Output<GetSpaceRolesResult> getSpaceRoles(GetSpaceRolesArgs args, InvokeOptions options)
    public static Output<GetSpaceRolesResult> getSpaceRoles(GetSpaceRolesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: cloudfoundry:index/getSpaceRoles:getSpaceRoles
      arguments:
        # arguments dictionary
    data "cloudfoundry_get_space_roles" "name" {
        # arguments
    }

    The following arguments are supported:

    Space string
    The guid of the space the role is assigned to
    Type string
    Valid space role type to filter for; see Valid role types
    User string
    The guid of the cloudfoundry user the role is assigned to for filtering
    Space string
    The guid of the space the role is assigned to
    Type string
    Valid space role type to filter for; see Valid role types
    User string
    The guid of the cloudfoundry user the role is assigned to for filtering
    space string
    The guid of the space the role is assigned to
    type string
    Valid space role type to filter for; see Valid role types
    user string
    The guid of the cloudfoundry user the role is assigned to for filtering
    space String
    The guid of the space the role is assigned to
    type String
    Valid space role type to filter for; see Valid role types
    user String
    The guid of the cloudfoundry user the role is assigned to for filtering
    space string
    The guid of the space the role is assigned to
    type string
    Valid space role type to filter for; see Valid role types
    user string
    The guid of the cloudfoundry user the role is assigned to for filtering
    space str
    The guid of the space the role is assigned to
    type str
    Valid space role type to filter for; see Valid role types
    user str
    The guid of the cloudfoundry user the role is assigned to for filtering
    space String
    The guid of the space the role is assigned to
    type String
    Valid space role type to filter for; see Valid role types
    user String
    The guid of the cloudfoundry user the role is assigned to for filtering

    getSpaceRoles Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Roles List<GetSpaceRolesRole>
    The list of space roles
    Space string
    The guid of the space the role is assigned to
    Type string
    Valid space role type to filter for; see Valid role types
    User string
    The guid of the cloudfoundry user the role is assigned to for filtering
    Id string
    The provider-assigned unique ID for this managed resource.
    Roles []GetSpaceRolesRole
    The list of space roles
    Space string
    The guid of the space the role is assigned to
    Type string
    Valid space role type to filter for; see Valid role types
    User string
    The guid of the cloudfoundry user the role is assigned to for filtering
    id string
    The provider-assigned unique ID for this managed resource.
    roles list(object)
    The list of space roles
    space string
    The guid of the space the role is assigned to
    type string
    Valid space role type to filter for; see Valid role types
    user string
    The guid of the cloudfoundry user the role is assigned to for filtering
    id String
    The provider-assigned unique ID for this managed resource.
    roles List<GetSpaceRolesRole>
    The list of space roles
    space String
    The guid of the space the role is assigned to
    type String
    Valid space role type to filter for; see Valid role types
    user String
    The guid of the cloudfoundry user the role is assigned to for filtering
    id string
    The provider-assigned unique ID for this managed resource.
    roles GetSpaceRolesRole[]
    The list of space roles
    space string
    The guid of the space the role is assigned to
    type string
    Valid space role type to filter for; see Valid role types
    user string
    The guid of the cloudfoundry user the role is assigned to for filtering
    id str
    The provider-assigned unique ID for this managed resource.
    roles Sequence[GetSpaceRolesRole]
    The list of space roles
    space str
    The guid of the space the role is assigned to
    type str
    Valid space role type to filter for; see Valid role types
    user str
    The guid of the cloudfoundry user the role is assigned to for filtering
    id String
    The provider-assigned unique ID for this managed resource.
    roles List<Property Map>
    The list of space roles
    space String
    The guid of the space the role is assigned to
    type String
    Valid space role type to filter for; see Valid role types
    user String
    The guid of the cloudfoundry user the role is assigned to for filtering

    Supporting Types

    GetSpaceRolesRole

    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The guid for the role
    Space string
    The guid of the organization the role is assigned to
    Type string
    role type
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    User string
    The guid of the cloudfoundry user the role is assigned to
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The guid for the role
    Space string
    The guid of the organization the role is assigned to
    Type string
    role type
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    User string
    The guid of the cloudfoundry user the role is assigned to
    created_at string
    The date and time when the resource was created in RFC3339 format.
    id string
    The guid for the role
    space string
    The guid of the organization the role is assigned to
    type string
    role type
    updated_at string
    The date and time when the resource was updated in RFC3339 format.
    user string
    The guid of the cloudfoundry user the role is assigned to
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    id String
    The guid for the role
    space String
    The guid of the organization the role is assigned to
    type String
    role type
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    user String
    The guid of the cloudfoundry user the role is assigned to
    createdAt string
    The date and time when the resource was created in RFC3339 format.
    id string
    The guid for the role
    space string
    The guid of the organization the role is assigned to
    type string
    role type
    updatedAt string
    The date and time when the resource was updated in RFC3339 format.
    user string
    The guid of the cloudfoundry user the role is assigned to
    created_at str
    The date and time when the resource was created in RFC3339 format.
    id str
    The guid for the role
    space str
    The guid of the organization the role is assigned to
    type str
    role type
    updated_at str
    The date and time when the resource was updated in RFC3339 format.
    user str
    The guid of the cloudfoundry user the role is assigned to
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    id String
    The guid for the role
    space String
    The guid of the organization the role is assigned to
    type String
    role type
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    user String
    The guid of the cloudfoundry user the role is assigned to

    Package Details

    Repository
    cloudfoundry cloudfoundry/terraform-provider-cloudfoundry
    License
    Notes
    This Pulumi package is based on the cloudfoundry Terraform Provider.
    cloudfoundry
    Viewing docs for cloudfoundry 1.18.0
    published on Monday, Nov 2, 2026 by cloudfoundry

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial