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

    Gets information on a Cloud Foundry application security group.

    Example Usage

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

    Using getSecurityGroup

    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 getSecurityGroup(args: GetSecurityGroupArgs, opts?: InvokeOptions): Promise<GetSecurityGroupResult>
    function getSecurityGroupOutput(args: GetSecurityGroupOutputArgs, opts?: InvokeOutputOptions): Output<GetSecurityGroupResult>
    def get_security_group(name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSecurityGroupResult
    def get_security_group_output(name: pulumi.Input[Optional[str]] = None,
                           opts: Optional[InvokeOutputOptions] = None) -> Output[GetSecurityGroupResult]
    func LookupSecurityGroup(ctx *Context, args *LookupSecurityGroupArgs, opts ...InvokeOption) (*LookupSecurityGroupResult, error)
    func LookupSecurityGroupOutput(ctx *Context, args *LookupSecurityGroupOutputArgs, opts ...InvokeOption) LookupSecurityGroupResultOutput

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

    public static class GetSecurityGroup 
    {
        public static Task<GetSecurityGroupResult> InvokeAsync(GetSecurityGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupResult> Invoke(GetSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupResult> Invoke(GetSecurityGroupInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOptions options)
    public static Output<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOptions options)
    public static Output<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: cloudfoundry:index/getSecurityGroup:getSecurityGroup
      arguments:
        # arguments dictionary
    data "cloudfoundry_get_security_group" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    Name of the security group
    Name string
    Name of the security group
    name string
    Name of the security group
    name String
    Name of the security group
    name string
    Name of the security group
    name str
    Name of the security group
    name String
    Name of the security group

    getSecurityGroup Result

    The following output properties are available:

    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<GetSecurityGroupRule>
    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 []GetSecurityGroupRule
    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<GetSecurityGroupRule>
    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 GetSecurityGroupRule[]
    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[GetSecurityGroupRule]
    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.

    Supporting Types

    GetSecurityGroupRule

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

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial