1. Registry
  2. Packages
  3. Cloudfoundry Provider
  4. API Docs
  5. getSpaces
Viewing docs for cloudfoundry 1.19.0
published on Friday, Nov 13, 2026 by cloudfoundry
cloudfoundry
Viewing docs for cloudfoundry 1.19.0
published on Friday, Nov 13, 2026 by cloudfoundry

    Lists all spaces under an organization.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    export = async () => {
        const spaces = await cloudfoundry.getSpaces({
            org: "784b4cd0-4771-4e4d-9052-a07e178bae56f",
        });
        return {
            spaces: spaces,
        };
    }
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    spaces = cloudfoundry.get_spaces(org="784b4cd0-4771-4e4d-9052-a07e178bae56f")
    pulumi.export("spaces", spaces)
    
    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 {
    		spaces, err := cloudfoundry.GetSpaces(ctx, &cloudfoundry.GetSpacesArgs{
    			Org: "784b4cd0-4771-4e4d-9052-a07e178bae56f",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("spaces", spaces)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudfoundry = Pulumi.Cloudfoundry;
    
    return await Deployment.RunAsync(() => 
    {
        var spaces = Cloudfoundry.GetSpaces.Invoke(new()
        {
            Org = "784b4cd0-4771-4e4d-9052-a07e178bae56f",
        });
    
        return new Dictionary<string, object?>
        {
            ["spaces"] = spaces,
        };
    });
    
    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.GetSpacesArgs;
    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 spaces = CloudfoundryFunctions.getSpaces(GetSpacesArgs.builder()
                .org("784b4cd0-4771-4e4d-9052-a07e178bae56f")
                .build());
    
            ctx.export("spaces", spaces);
        }
    }
    
    variables:
      spaces:
        fn::invoke:
          function: cloudfoundry:getSpaces
          arguments:
            org: 784b4cd0-4771-4e4d-9052-a07e178bae56f
    outputs:
      spaces: ${spaces}
    
    Example coming soon!
    

    Using getSpaces

    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 getSpaces(args: GetSpacesArgs, opts?: InvokeOptions): Promise<GetSpacesResult>
    function getSpacesOutput(args: GetSpacesOutputArgs, opts?: InvokeOutputOptions): Output<GetSpacesResult>
    def get_spaces(name: Optional[str] = None,
                   org: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetSpacesResult
    def get_spaces_output(name: pulumi.Input[Optional[str]] = None,
                   org: pulumi.Input[Optional[str]] = None,
                   opts: Optional[InvokeOutputOptions] = None) -> Output[GetSpacesResult]
    func GetSpaces(ctx *Context, args *GetSpacesArgs, opts ...InvokeOption) (*GetSpacesResult, error)
    func GetSpacesOutput(ctx *Context, args *GetSpacesOutputArgs, opts ...InvokeOption) GetSpacesResultOutput

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

    public static class GetSpaces 
    {
        public static Task<GetSpacesResult> InvokeAsync(GetSpacesArgs args, InvokeOptions? opts = null)
        public static Output<GetSpacesResult> Invoke(GetSpacesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetSpacesResult> Invoke(GetSpacesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetSpacesResult> getSpaces(GetSpacesArgs args, InvokeOptions options)
    public static Output<GetSpacesResult> getSpaces(GetSpacesArgs args, InvokeOptions options)
    public static Output<GetSpacesResult> getSpaces(GetSpacesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: cloudfoundry:index/getSpaces:getSpaces
      arguments:
        # arguments dictionary
    data "cloudfoundry_get_spaces" "name" {
        # arguments
    }

    The following arguments are supported:

    Org string
    The GUID of the organization under which the spaces exist
    Name string
    The name of the space to look up
    Org string
    The GUID of the organization under which the spaces exist
    Name string
    The name of the space to look up
    org string
    The GUID of the organization under which the spaces exist
    name string
    The name of the space to look up
    org String
    The GUID of the organization under which the spaces exist
    name String
    The name of the space to look up
    org string
    The GUID of the organization under which the spaces exist
    name string
    The name of the space to look up
    org str
    The GUID of the organization under which the spaces exist
    name str
    The name of the space to look up
    org String
    The GUID of the organization under which the spaces exist
    name String
    The name of the space to look up

    getSpaces Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Org string
    The GUID of the organization under which the spaces exist
    Spaces List<GetSpacesSpace>
    The spaces present under the organization
    Name string
    The name of the space to look up
    Id string
    The provider-assigned unique ID for this managed resource.
    Org string
    The GUID of the organization under which the spaces exist
    Spaces []GetSpacesSpace
    The spaces present under the organization
    Name string
    The name of the space to look up
    id string
    The provider-assigned unique ID for this managed resource.
    org string
    The GUID of the organization under which the spaces exist
    spaces list(object)
    The spaces present under the organization
    name string
    The name of the space to look up
    id String
    The provider-assigned unique ID for this managed resource.
    org String
    The GUID of the organization under which the spaces exist
    spaces List<GetSpacesSpace>
    The spaces present under the organization
    name String
    The name of the space to look up
    id string
    The provider-assigned unique ID for this managed resource.
    org string
    The GUID of the organization under which the spaces exist
    spaces GetSpacesSpace[]
    The spaces present under the organization
    name string
    The name of the space to look up
    id str
    The provider-assigned unique ID for this managed resource.
    org str
    The GUID of the organization under which the spaces exist
    spaces Sequence[GetSpacesSpace]
    The spaces present under the organization
    name str
    The name of the space to look up
    id String
    The provider-assigned unique ID for this managed resource.
    org String
    The GUID of the organization under which the spaces exist
    spaces List<Property Map>
    The spaces present under the organization
    name String
    The name of the space to look up

    Supporting Types

    GetSpacesSpace

    AllowSsh bool
    Allows SSH to application containers via the CF CLI.
    Annotations Dictionary<string, string>
    The annotations associated with Cloud Foundry resources.
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The GUID of the object.
    IsolationSegment string
    The ID of the isolation segment assigned to the space.
    Labels Dictionary<string, string>
    The labels associated with Cloud Foundry resources.
    Name string
    name of the space
    Org string
    The GUID of the organization the space is contained in
    Quota string
    The space quota applied to the space
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    AllowSsh bool
    Allows SSH to application containers via the CF CLI.
    Annotations map[string]string
    The annotations associated with Cloud Foundry resources.
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The GUID of the object.
    IsolationSegment string
    The ID of the isolation segment assigned to the space.
    Labels map[string]string
    The labels associated with Cloud Foundry resources.
    Name string
    name of the space
    Org string
    The GUID of the organization the space is contained in
    Quota string
    The space quota applied to the space
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    allow_ssh bool
    Allows SSH to application containers via the CF CLI.
    annotations map(string)
    The annotations associated with Cloud Foundry resources.
    created_at string
    The date and time when the resource was created in RFC3339 format.
    id string
    The GUID of the object.
    isolation_segment string
    The ID of the isolation segment assigned to the space.
    labels map(string)
    The labels associated with Cloud Foundry resources.
    name string
    name of the space
    org string
    The GUID of the organization the space is contained in
    quota string
    The space quota applied to the space
    updated_at string
    The date and time when the resource was updated in RFC3339 format.
    allowSsh Boolean
    Allows SSH to application containers via the CF CLI.
    annotations Map<String,String>
    The annotations associated with Cloud Foundry resources.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    id String
    The GUID of the object.
    isolationSegment String
    The ID of the isolation segment assigned to the space.
    labels Map<String,String>
    The labels associated with Cloud Foundry resources.
    name String
    name of the space
    org String
    The GUID of the organization the space is contained in
    quota String
    The space quota applied to the space
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    allowSsh boolean
    Allows SSH to application containers via the CF CLI.
    annotations {[key: string]: string}
    The annotations associated with Cloud Foundry resources.
    createdAt string
    The date and time when the resource was created in RFC3339 format.
    id string
    The GUID of the object.
    isolationSegment string
    The ID of the isolation segment assigned to the space.
    labels {[key: string]: string}
    The labels associated with Cloud Foundry resources.
    name string
    name of the space
    org string
    The GUID of the organization the space is contained in
    quota string
    The space quota applied to the space
    updatedAt string
    The date and time when the resource was updated in RFC3339 format.
    allow_ssh bool
    Allows SSH to application containers via the CF CLI.
    annotations Mapping[str, str]
    The annotations associated with Cloud Foundry resources.
    created_at str
    The date and time when the resource was created in RFC3339 format.
    id str
    The GUID of the object.
    isolation_segment str
    The ID of the isolation segment assigned to the space.
    labels Mapping[str, str]
    The labels associated with Cloud Foundry resources.
    name str
    name of the space
    org str
    The GUID of the organization the space is contained in
    quota str
    The space quota applied to the space
    updated_at str
    The date and time when the resource was updated in RFC3339 format.
    allowSsh Boolean
    Allows SSH to application containers via the CF CLI.
    annotations Map<String>
    The annotations associated with Cloud Foundry resources.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    id String
    The GUID of the object.
    isolationSegment String
    The ID of the isolation segment assigned to the space.
    labels Map<String>
    The labels associated with Cloud Foundry resources.
    name String
    name of the space
    org String
    The GUID of the organization the space is contained in
    quota String
    The space quota applied to the space
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.

    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.19.0
    published on Friday, Nov 13, 2026 by cloudfoundry

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial