1. Registry
  2. Packages
  3. Cloudfoundry Provider
  4. API Docs
  5. getSecurityGroups
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 application security groups.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const sgroups = cloudfoundry.getSecurityGroups({
        name: "riemann",
    });
    export const sgroup = sgroups;
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    sgroups = cloudfoundry.get_security_groups(name="riemann")
    pulumi.export("sgroup", sgroups)
    
    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 {
    		sgroups, err := cloudfoundry.GetSecurityGroups(ctx, &cloudfoundry.GetSecurityGroupsArgs{
    			Name: pulumi.StringRef("riemann"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("sgroup", sgroups)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudfoundry = Pulumi.Cloudfoundry;
    
    return await Deployment.RunAsync(() => 
    {
        var sgroups = Cloudfoundry.GetSecurityGroups.Invoke(new()
        {
            Name = "riemann",
        });
    
        return new Dictionary<string, object?>
        {
            ["sgroup"] = sgroups,
        };
    });
    
    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.GetSecurityGroupsArgs;
    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 sgroups = CloudfoundryFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .name("riemann")
                .build());
    
            ctx.export("sgroup", sgroups);
        }
    }
    
    variables:
      sgroups:
        fn::invoke:
          function: cloudfoundry:getSecurityGroups
          arguments:
            name: riemann
    outputs:
      sgroup: ${sgroups}
    
    Example coming soon!
    

    Using getSecurityGroups

    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 getSecurityGroups(args: GetSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetSecurityGroupsResult>
    function getSecurityGroupsOutput(args: GetSecurityGroupsOutputArgs, opts?: InvokeOutputOptions): Output<GetSecurityGroupsResult>
    def get_security_groups(name: Optional[str] = None,
                            running_space: Optional[str] = None,
                            staging_space: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSecurityGroupsResult
    def get_security_groups_output(name: pulumi.Input[Optional[str]] = None,
                            running_space: pulumi.Input[Optional[str]] = None,
                            staging_space: pulumi.Input[Optional[str]] = None,
                            opts: Optional[InvokeOutputOptions] = None) -> Output[GetSecurityGroupsResult]
    func GetSecurityGroups(ctx *Context, args *GetSecurityGroupsArgs, opts ...InvokeOption) (*GetSecurityGroupsResult, error)
    func GetSecurityGroupsOutput(ctx *Context, args *GetSecurityGroupsOutputArgs, opts ...InvokeOption) GetSecurityGroupsResultOutput

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

    public static class GetSecurityGroups 
    {
        public static Task<GetSecurityGroupsResult> InvokeAsync(GetSecurityGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupsResult> Invoke(GetSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupsResult> Invoke(GetSecurityGroupsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
    public static Output<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
    public static Output<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: cloudfoundry:index/getSecurityGroups:getSecurityGroups
      arguments:
        # arguments dictionary
    data "cloudfoundry_get_security_groups" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    Name of the security group to filter by
    RunningSpace string
    The GUID of the running space to filter by
    StagingSpace string
    The GUID of the staging space to filter by
    Name string
    Name of the security group to filter by
    RunningSpace string
    The GUID of the running space to filter by
    StagingSpace string
    The GUID of the staging space to filter by
    name string
    Name of the security group to filter by
    running_space string
    The GUID of the running space to filter by
    staging_space string
    The GUID of the staging space to filter by
    name String
    Name of the security group to filter by
    runningSpace String
    The GUID of the running space to filter by
    stagingSpace String
    The GUID of the staging space to filter by
    name string
    Name of the security group to filter by
    runningSpace string
    The GUID of the running space to filter by
    stagingSpace string
    The GUID of the staging space to filter by
    name str
    Name of the security group to filter by
    running_space str
    The GUID of the running space to filter by
    staging_space str
    The GUID of the staging space to filter by
    name String
    Name of the security group to filter by
    runningSpace String
    The GUID of the running space to filter by
    stagingSpace String
    The GUID of the staging space to filter by

    getSecurityGroups Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    SecurityGroups List<GetSecurityGroupsSecurityGroup>
    List of security groups
    Name string
    Name of the security group to filter by
    RunningSpace string
    The GUID of the running space to filter by
    StagingSpace string
    The GUID of the staging space to filter by
    Id string
    The provider-assigned unique ID for this managed resource.
    SecurityGroups []GetSecurityGroupsSecurityGroup
    List of security groups
    Name string
    Name of the security group to filter by
    RunningSpace string
    The GUID of the running space to filter by
    StagingSpace string
    The GUID of the staging space to filter by
    id string
    The provider-assigned unique ID for this managed resource.
    security_groups list(object)
    List of security groups
    name string
    Name of the security group to filter by
    running_space string
    The GUID of the running space to filter by
    staging_space string
    The GUID of the staging space to filter by
    id String
    The provider-assigned unique ID for this managed resource.
    securityGroups List<GetSecurityGroupsSecurityGroup>
    List of security groups
    name String
    Name of the security group to filter by
    runningSpace String
    The GUID of the running space to filter by
    stagingSpace String
    The GUID of the staging space to filter by
    id string
    The provider-assigned unique ID for this managed resource.
    securityGroups GetSecurityGroupsSecurityGroup[]
    List of security groups
    name string
    Name of the security group to filter by
    runningSpace string
    The GUID of the running space to filter by
    stagingSpace string
    The GUID of the staging space to filter by
    id str
    The provider-assigned unique ID for this managed resource.
    security_groups Sequence[GetSecurityGroupsSecurityGroup]
    List of security groups
    name str
    Name of the security group to filter by
    running_space str
    The GUID of the running space to filter by
    staging_space str
    The GUID of the staging space to filter by
    id String
    The provider-assigned unique ID for this managed resource.
    securityGroups List<Property Map>
    List of security groups
    name String
    Name of the security group to filter by
    runningSpace String
    The GUID of the running space to filter by
    stagingSpace String
    The GUID of the staging space to filter by

    Supporting Types

    GetSecurityGroupsSecurityGroup

    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    GloballyEnabledRunning bool
    Specifies whether the group should be applied globally to all running applications
    GloballyEnabledStaging bool
    Specifies whether the group should be applied globally to all staging applications
    Id string
    The GUID of the object.
    Name string
    Name of the security group
    Rules List<GetSecurityGroupsSecurityGroupRule>
    Rules that will be applied by this security group
    RunningSpaces List<string>
    The spaces where the security_group is applied to applications during runtime
    StagingSpaces List<string>
    The spaces where the security_group is applied to applications during stagingo
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    GloballyEnabledRunning bool
    Specifies whether the group should be applied globally to all running applications
    GloballyEnabledStaging bool
    Specifies whether the group should be applied globally to all staging applications
    Id string
    The GUID of the object.
    Name string
    Name of the security group
    Rules []GetSecurityGroupsSecurityGroupRule
    Rules that will be applied by this security group
    RunningSpaces []string
    The spaces where the security_group is applied to applications during runtime
    StagingSpaces []string
    The spaces where the security_group is applied to applications during stagingo
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    created_at string
    The date and time when the resource was created in RFC3339 format.
    globally_enabled_running bool
    Specifies whether the group should be applied globally to all running applications
    globally_enabled_staging bool
    Specifies whether the group should be applied globally to all staging applications
    id string
    The GUID of the object.
    name string
    Name of the security group
    rules list(object)
    Rules that will be applied by this security group
    running_spaces list(string)
    The spaces where the security_group is applied to applications during runtime
    staging_spaces list(string)
    The spaces where the security_group is applied to applications during stagingo
    updated_at string
    The date and time when the resource was updated in RFC3339 format.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    globallyEnabledRunning Boolean
    Specifies whether the group should be applied globally to all running applications
    globallyEnabledStaging Boolean
    Specifies whether the group should be applied globally to all staging applications
    id String
    The GUID of the object.
    name String
    Name of the security group
    rules List<GetSecurityGroupsSecurityGroupRule>
    Rules that will be applied by this security group
    runningSpaces List<String>
    The spaces where the security_group is applied to applications during runtime
    stagingSpaces List<String>
    The spaces where the security_group is applied to applications during stagingo
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    createdAt string
    The date and time when the resource was created in RFC3339 format.
    globallyEnabledRunning boolean
    Specifies whether the group should be applied globally to all running applications
    globallyEnabledStaging boolean
    Specifies whether the group should be applied globally to all staging applications
    id string
    The GUID of the object.
    name string
    Name of the security group
    rules GetSecurityGroupsSecurityGroupRule[]
    Rules that will be applied by this security group
    runningSpaces string[]
    The spaces where the security_group is applied to applications during runtime
    stagingSpaces string[]
    The spaces where the security_group is applied to applications during stagingo
    updatedAt string
    The date and time when the resource was updated in RFC3339 format.
    created_at str
    The date and time when the resource was created in RFC3339 format.
    globally_enabled_running bool
    Specifies whether the group should be applied globally to all running applications
    globally_enabled_staging bool
    Specifies whether the group should be applied globally to all staging applications
    id str
    The GUID of the object.
    name str
    Name of the security group
    rules Sequence[GetSecurityGroupsSecurityGroupRule]
    Rules that will be applied by this security group
    running_spaces Sequence[str]
    The spaces where the security_group is applied to applications during runtime
    staging_spaces Sequence[str]
    The spaces where the security_group is applied to applications during stagingo
    updated_at str
    The date and time when the resource was updated in RFC3339 format.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    globallyEnabledRunning Boolean
    Specifies whether the group should be applied globally to all running applications
    globallyEnabledStaging Boolean
    Specifies whether the group should be applied globally to all staging applications
    id String
    The GUID of the object.
    name String
    Name of the security group
    rules List<Property Map>
    Rules that will be applied by this security group
    runningSpaces List<String>
    The spaces where the security_group is applied to applications during runtime
    stagingSpaces List<String>
    The spaces where the security_group is applied to applications during stagingo
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.

    GetSecurityGroupsSecurityGroupRule

    Code double
    Code field of the ICMP type
    Description string
    A description for the rule
    Destination string
    Destinations that the rule applies to
    Log bool
    Whether logging for the rule is enabled
    Ports string
    Ports that the rule applies to
    Protocol string
    Protocol type
    Type double
    Type number for ICMP protocol
    Code float64
    Code field of the ICMP type
    Description string
    A description for the rule
    Destination string
    Destinations that the rule applies to
    Log bool
    Whether logging for the rule is enabled
    Ports string
    Ports that the rule applies to
    Protocol string
    Protocol type
    Type float64
    Type number for ICMP protocol
    code number
    Code field of the ICMP type
    description string
    A description for the rule
    destination string
    Destinations that the rule applies to
    log bool
    Whether logging for the rule is enabled
    ports string
    Ports that the rule applies to
    protocol string
    Protocol type
    type number
    Type number for ICMP protocol
    code Double
    Code field of the ICMP type
    description String
    A description for the rule
    destination String
    Destinations that the rule applies to
    log Boolean
    Whether logging for the rule is enabled
    ports String
    Ports that the rule applies to
    protocol String
    Protocol type
    type Double
    Type number for ICMP protocol
    code number
    Code field of the ICMP type
    description string
    A description for the rule
    destination string
    Destinations that the rule applies to
    log boolean
    Whether logging for the rule is enabled
    ports string
    Ports that the rule applies to
    protocol string
    Protocol type
    type number
    Type number for ICMP protocol
    code float
    Code field of the ICMP type
    description str
    A description for the rule
    destination str
    Destinations that the rule applies to
    log bool
    Whether logging for the rule is enabled
    ports str
    Ports that the rule applies to
    protocol str
    Protocol type
    type float
    Type number for ICMP protocol
    code Number
    Code field of the ICMP type
    description String
    A description for the rule
    destination String
    Destinations that the rule applies to
    log Boolean
    Whether logging for the rule is enabled
    ports String
    Ports that the rule applies to
    protocol String
    Protocol type
    type Number
    Type number for ICMP protocol

    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