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

    Provides an application security group resource for Cloud Foundry. This resource defines egress rules that can be applied to containers that stage and run applications.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const mySecurityGroup = new cloudfoundry.SecurityGroup("my_security_group", {
        name: "tf-test",
        globallyEnabledRunning: false,
        globallyEnabledStaging: false,
        rules: [
            {
                protocol: "tcp",
                destination: "192.168.1.100",
                ports: "1883,8883",
                log: true,
            },
            {
                protocol: "udp",
                destination: "192.168.1.100",
                ports: "1883,8883",
                log: false,
            },
            {
                protocol: "icmp",
                type: 0,
                code: 0,
                destination: "192.168.1.100",
                log: false,
            },
        ],
        stagingSpaces: [
            "3bc20dc4-1870-4835-8308-dda2d766e61e",
            "e6886bba-e263-4b52-aaf1-85d410f15fc8",
        ],
        runningSpaces: ["e6886bba-e263-4b52-aaf1-85d410f15fc8"],
    });
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    my_security_group = cloudfoundry.SecurityGroup("my_security_group",
        name="tf-test",
        globally_enabled_running=False,
        globally_enabled_staging=False,
        rules=[
            {
                "protocol": "tcp",
                "destination": "192.168.1.100",
                "ports": "1883,8883",
                "log": True,
            },
            {
                "protocol": "udp",
                "destination": "192.168.1.100",
                "ports": "1883,8883",
                "log": False,
            },
            {
                "protocol": "icmp",
                "type": 0,
                "code": 0,
                "destination": "192.168.1.100",
                "log": False,
            },
        ],
        staging_spaces=[
            "3bc20dc4-1870-4835-8308-dda2d766e61e",
            "e6886bba-e263-4b52-aaf1-85d410f15fc8",
        ],
        running_spaces=["e6886bba-e263-4b52-aaf1-85d410f15fc8"])
    
    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.NewSecurityGroup(ctx, "my_security_group", &cloudfoundry.SecurityGroupArgs{
    			Name:                   pulumi.String("tf-test"),
    			GloballyEnabledRunning: pulumi.Bool(false),
    			GloballyEnabledStaging: pulumi.Bool(false),
    			Rules: cloudfoundry.SecurityGroupRuleArray{
    				&cloudfoundry.SecurityGroupRuleArgs{
    					Protocol:    pulumi.String("tcp"),
    					Destination: pulumi.String("192.168.1.100"),
    					Ports:       pulumi.String("1883,8883"),
    					Log:         pulumi.Bool(true),
    				},
    				&cloudfoundry.SecurityGroupRuleArgs{
    					Protocol:    pulumi.String("udp"),
    					Destination: pulumi.String("192.168.1.100"),
    					Ports:       pulumi.String("1883,8883"),
    					Log:         pulumi.Bool(false),
    				},
    				&cloudfoundry.SecurityGroupRuleArgs{
    					Protocol:    pulumi.String("icmp"),
    					Type:        pulumi.Float64(0),
    					Code:        pulumi.Float64(0),
    					Destination: pulumi.String("192.168.1.100"),
    					Log:         pulumi.Bool(false),
    				},
    			},
    			StagingSpaces: pulumi.StringArray{
    				pulumi.String("3bc20dc4-1870-4835-8308-dda2d766e61e"),
    				pulumi.String("e6886bba-e263-4b52-aaf1-85d410f15fc8"),
    			},
    			RunningSpaces: pulumi.StringArray{
    				pulumi.String("e6886bba-e263-4b52-aaf1-85d410f15fc8"),
    			},
    		})
    		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 mySecurityGroup = new Cloudfoundry.SecurityGroup("my_security_group", new()
        {
            Name = "tf-test",
            GloballyEnabledRunning = false,
            GloballyEnabledStaging = false,
            Rules = new[]
            {
                new Cloudfoundry.Inputs.SecurityGroupRuleArgs
                {
                    Protocol = "tcp",
                    Destination = "192.168.1.100",
                    Ports = "1883,8883",
                    Log = true,
                },
                new Cloudfoundry.Inputs.SecurityGroupRuleArgs
                {
                    Protocol = "udp",
                    Destination = "192.168.1.100",
                    Ports = "1883,8883",
                    Log = false,
                },
                new Cloudfoundry.Inputs.SecurityGroupRuleArgs
                {
                    Protocol = "icmp",
                    Type = 0,
                    Code = 0,
                    Destination = "192.168.1.100",
                    Log = false,
                },
            },
            StagingSpaces = new[]
            {
                "3bc20dc4-1870-4835-8308-dda2d766e61e",
                "e6886bba-e263-4b52-aaf1-85d410f15fc8",
            },
            RunningSpaces = new[]
            {
                "e6886bba-e263-4b52-aaf1-85d410f15fc8",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudfoundry.SecurityGroup;
    import com.pulumi.cloudfoundry.SecurityGroupArgs;
    import com.pulumi.cloudfoundry.inputs.SecurityGroupRuleArgs;
    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) {
            var mySecurityGroup = new SecurityGroup("mySecurityGroup", SecurityGroupArgs.builder()
                .name("tf-test")
                .globallyEnabledRunning(false)
                .globallyEnabledStaging(false)
                .rules(            
                    SecurityGroupRuleArgs.builder()
                        .protocol("tcp")
                        .destination("192.168.1.100")
                        .ports("1883,8883")
                        .log(true)
                        .build(),
                    SecurityGroupRuleArgs.builder()
                        .protocol("udp")
                        .destination("192.168.1.100")
                        .ports("1883,8883")
                        .log(false)
                        .build(),
                    SecurityGroupRuleArgs.builder()
                        .protocol("icmp")
                        .type(0.0)
                        .code(0.0)
                        .destination("192.168.1.100")
                        .log(false)
                        .build())
                .stagingSpaces(            
                    "3bc20dc4-1870-4835-8308-dda2d766e61e",
                    "e6886bba-e263-4b52-aaf1-85d410f15fc8")
                .runningSpaces("e6886bba-e263-4b52-aaf1-85d410f15fc8")
                .build());
    
        }
    }
    
    resources:
      mySecurityGroup:
        type: cloudfoundry:SecurityGroup
        name: my_security_group
        properties:
          name: tf-test
          globallyEnabledRunning: false
          globallyEnabledStaging: false
          rules:
            - protocol: tcp
              destination: 192.168.1.100
              ports: 1883,8883
              log: true
            - protocol: udp
              destination: 192.168.1.100
              ports: 1883,8883
              log: false
            - protocol: icmp
              type: 0
              code: 0
              destination: 192.168.1.100
              log: false
          stagingSpaces:
            - 3bc20dc4-1870-4835-8308-dda2d766e61e
            - e6886bba-e263-4b52-aaf1-85d410f15fc8
          runningSpaces:
            - e6886bba-e263-4b52-aaf1-85d410f15fc8
    
    Example coming soon!
    

    Create SecurityGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SecurityGroup(name: string, args?: SecurityGroupArgs, opts?: CustomResourceOptions);
    @overload
    def SecurityGroup(resource_name: str,
                      args: Optional[SecurityGroupArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecurityGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      globally_enabled_running: Optional[bool] = None,
                      globally_enabled_staging: Optional[bool] = None,
                      name: Optional[str] = None,
                      rules: Optional[Sequence[SecurityGroupRuleArgs]] = None,
                      running_spaces: Optional[Sequence[str]] = None,
                      staging_spaces: Optional[Sequence[str]] = None)
    func NewSecurityGroup(ctx *Context, name string, args *SecurityGroupArgs, opts ...ResourceOption) (*SecurityGroup, error)
    public SecurityGroup(string name, SecurityGroupArgs? args = null, CustomResourceOptions? opts = null)
    public SecurityGroup(String name, SecurityGroupArgs args)
    public SecurityGroup(String name, SecurityGroupArgs args, CustomResourceOptions options)
    
    type: cloudfoundry:SecurityGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "cloudfoundry_security_group" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args SecurityGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SecurityGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SecurityGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecurityGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecurityGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var securityGroupResource = new Cloudfoundry.SecurityGroup("securityGroupResource", new()
    {
        GloballyEnabledRunning = false,
        GloballyEnabledStaging = false,
        Name = "string",
        Rules = new[]
        {
            new Cloudfoundry.Inputs.SecurityGroupRuleArgs
            {
                Destination = "string",
                Protocol = "string",
                Code = 0.0,
                Description = "string",
                Log = false,
                Ports = "string",
                Type = 0.0,
            },
        },
        RunningSpaces = new[]
        {
            "string",
        },
        StagingSpaces = new[]
        {
            "string",
        },
    });
    
    example, err := cloudfoundry.NewSecurityGroup(ctx, "securityGroupResource", &cloudfoundry.SecurityGroupArgs{
    	GloballyEnabledRunning: pulumi.Bool(false),
    	GloballyEnabledStaging: pulumi.Bool(false),
    	Name:                   pulumi.String("string"),
    	Rules: cloudfoundry.SecurityGroupRuleArray{
    		&cloudfoundry.SecurityGroupRuleArgs{
    			Destination: pulumi.String("string"),
    			Protocol:    pulumi.String("string"),
    			Code:        pulumi.Float64(0),
    			Description: pulumi.String("string"),
    			Log:         pulumi.Bool(false),
    			Ports:       pulumi.String("string"),
    			Type:        pulumi.Float64(0),
    		},
    	},
    	RunningSpaces: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	StagingSpaces: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "cloudfoundry_security_group" "securityGroupResource" {
      lifecycle {
        create_before_destroy = true
      }
      globally_enabled_running = false
      globally_enabled_staging = false
      name                     = "string"
      rules {
        destination = "string"
        protocol    = "string"
        code        = 0
        description = "string"
        log         = false
        ports       = "string"
        type        = 0
      }
      running_spaces = ["string"]
      staging_spaces = ["string"]
    }
    
    var securityGroupResource = new SecurityGroup("securityGroupResource", SecurityGroupArgs.builder()
        .globallyEnabledRunning(false)
        .globallyEnabledStaging(false)
        .name("string")
        .rules(SecurityGroupRuleArgs.builder()
            .destination("string")
            .protocol("string")
            .code(0.0)
            .description("string")
            .log(false)
            .ports("string")
            .type(0.0)
            .build())
        .runningSpaces("string")
        .stagingSpaces("string")
        .build());
    
    security_group_resource = cloudfoundry.SecurityGroup("securityGroupResource",
        globally_enabled_running=False,
        globally_enabled_staging=False,
        name="string",
        rules=[{
            "destination": "string",
            "protocol": "string",
            "code": float(0),
            "description": "string",
            "log": False,
            "ports": "string",
            "type": float(0),
        }],
        running_spaces=["string"],
        staging_spaces=["string"])
    
    const securityGroupResource = new cloudfoundry.SecurityGroup("securityGroupResource", {
        globallyEnabledRunning: false,
        globallyEnabledStaging: false,
        name: "string",
        rules: [{
            destination: "string",
            protocol: "string",
            code: 0,
            description: "string",
            log: false,
            ports: "string",
            type: 0,
        }],
        runningSpaces: ["string"],
        stagingSpaces: ["string"],
    });
    
    type: cloudfoundry:SecurityGroup
    properties:
        globallyEnabledRunning: false
        globallyEnabledStaging: false
        name: string
        rules:
            - code: 0
              description: string
              destination: string
              log: false
              ports: string
              protocol: string
              type: 0
        runningSpaces:
            - string
        stagingSpaces:
            - string
    

    SecurityGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SecurityGroup resource accepts the following input properties:

    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
    Name string
    Name of the security group
    Rules List<SecurityGroupRule>
    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 staging
    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
    Name string
    Name of the security group
    Rules []SecurityGroupRuleArgs
    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 staging
    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
    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 staging
    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
    name String
    Name of the security group
    rules List<SecurityGroupRule>
    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 staging
    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
    name string
    Name of the security group
    rules SecurityGroupRule[]
    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 staging
    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
    name str
    Name of the security group
    rules Sequence[SecurityGroupRuleArgs]
    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 staging
    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
    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 staging

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SecurityGroup resource produces the following output properties:

    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The provider-assigned unique ID for this managed resource.
    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.
    Id string
    The provider-assigned unique ID for this managed resource.
    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.
    id string
    The provider-assigned unique ID for this managed resource.
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    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.
    id string
    The provider-assigned unique ID for this managed resource.
    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.
    id str
    The provider-assigned unique ID for this managed resource.
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.

    Look up Existing SecurityGroup Resource

    Get an existing SecurityGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SecurityGroupState, opts?: CustomResourceOptions): SecurityGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            globally_enabled_running: Optional[bool] = None,
            globally_enabled_staging: Optional[bool] = None,
            name: Optional[str] = None,
            rules: Optional[Sequence[SecurityGroupRuleArgs]] = None,
            running_spaces: Optional[Sequence[str]] = None,
            staging_spaces: Optional[Sequence[str]] = None,
            updated_at: Optional[str] = None) -> SecurityGroup
    func GetSecurityGroup(ctx *Context, name string, id IDInput, state *SecurityGroupState, opts ...ResourceOption) (*SecurityGroup, error)
    public static SecurityGroup Get(string name, Input<string> id, SecurityGroupState? state, CustomResourceOptions? opts = null)
    public static SecurityGroup get(String name, Output<String> id, SecurityGroupState state, CustomResourceOptions options)
    resources:  existingSecurityGroup:    type: cloudfoundry:SecurityGroup    get:      id: ${id}
    import {
      to = cloudfoundry_security_group.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state SecurityGroupState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state SecurityGroupState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state SecurityGroupState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state SecurityGroupState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    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
    Name string
    Name of the security group
    Rules List<SecurityGroupRule>
    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 staging
    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
    Name string
    Name of the security group
    Rules []SecurityGroupRuleArgs
    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 staging
    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
    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 staging
    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
    name String
    Name of the security group
    rules List<SecurityGroupRule>
    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 staging
    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
    name string
    Name of the security group
    rules SecurityGroupRule[]
    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 staging
    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
    name str
    Name of the security group
    rules Sequence[SecurityGroupRuleArgs]
    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 staging
    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
    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 staging
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.

    Supporting Types

    SecurityGroupRule, SecurityGroupRuleArgs

    Destination string
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    Protocol string
    Protocol type. Valid values are tcp, udp, icmp, or all
    Code double
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    Description string
    A description for the rule
    Log bool
    Enable logging for rule
    Ports string
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    Type double
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    Destination string
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    Protocol string
    Protocol type. Valid values are tcp, udp, icmp, or all
    Code float64
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    Description string
    A description for the rule
    Log bool
    Enable logging for rule
    Ports string
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    Type float64
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    destination string
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    protocol string
    Protocol type. Valid values are tcp, udp, icmp, or all
    code number
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    description string
    A description for the rule
    log bool
    Enable logging for rule
    ports string
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    type number
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    destination String
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    protocol String
    Protocol type. Valid values are tcp, udp, icmp, or all
    code Double
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    description String
    A description for the rule
    log Boolean
    Enable logging for rule
    ports String
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    type Double
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    destination string
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    protocol string
    Protocol type. Valid values are tcp, udp, icmp, or all
    code number
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    description string
    A description for the rule
    log boolean
    Enable logging for rule
    ports string
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    type number
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    destination str
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    protocol str
    Protocol type. Valid values are tcp, udp, icmp, or all
    code float
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    description str
    A description for the rule
    log bool
    Enable logging for rule
    ports str
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    type float
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    destination String
    Destinations that the rule applies to. Valid CIDR, IP address, or IP address range
    protocol String
    Protocol type. Valid values are tcp, udp, icmp, or all
    code Number
    Code required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all
    description String
    A description for the rule
    log Boolean
    Enable logging for rule
    ports String
    Ports that the rule applies to; can be a single port (9000), a comma-separated list (9000,9001), or a range (9000-9200)
    type Number
    Type required for ICMP protocol; valid values are between -1 and 255 (inclusive), where -1 allows all

    Import

    terraform

    $ pulumi import cloudfoundry:index/securityGroup:SecurityGroup <resource_name> <security_group_guid>
    
    $ pulumi import cloudfoundry:index/securityGroup:SecurityGroup my_security_group 283f59d2-d660-45fb-9d96-b3e1aa92cfc7
    
    $ pulumi import cloudfoundry:index/securityGroup:SecurityGroup #using id attribute in import block
    

    import {

    to = cloudfoundry_security_group.<resource_name>

    id = “<security_group_guid>”

    }

    this resource supports import using identity attribute from Terraform version 1.12 or higher

    import {

    to = cloudfoundry_security_group.<resource_name>

    identity = {

    security_group_guid = “<security_group_guid>”

    }

    }

    To learn more about importing existing cloud resources, see Importing resources.

    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