1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. ComputeSecgroupV2
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

opentelekomcloud.ComputeSecgroupV2

Explore with Pulumi AI

opentelekomcloud logo
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

    Up-to-date reference of API arguments for ECS security group management you can get at documentation portal

    Manages a V2 security group resource within OpenTelekomCloud.

    ~> Security group compute APIs are marked as discarded in documentation. Please use resource/opentelekomcloud_networking_secgroup_v2

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const secgroup1 = new opentelekomcloud.ComputeSecgroupV2("secgroup1", {
        description: "my security group",
        rules: [
            {
                cidr: "0.0.0.0/0",
                fromPort: 22,
                ipProtocol: "tcp",
                toPort: 22,
            },
            {
                cidr: "0.0.0.0/0",
                fromPort: 80,
                ipProtocol: "tcp",
                toPort: 80,
            },
        ],
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    secgroup1 = opentelekomcloud.ComputeSecgroupV2("secgroup1",
        description="my security group",
        rules=[
            {
                "cidr": "0.0.0.0/0",
                "from_port": 22,
                "ip_protocol": "tcp",
                "to_port": 22,
            },
            {
                "cidr": "0.0.0.0/0",
                "from_port": 80,
                "ip_protocol": "tcp",
                "to_port": 80,
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opentelekomcloud.NewComputeSecgroupV2(ctx, "secgroup1", &opentelekomcloud.ComputeSecgroupV2Args{
    			Description: pulumi.String("my security group"),
    			Rules: opentelekomcloud.ComputeSecgroupV2RuleArray{
    				&opentelekomcloud.ComputeSecgroupV2RuleArgs{
    					Cidr:       pulumi.String("0.0.0.0/0"),
    					FromPort:   pulumi.Float64(22),
    					IpProtocol: pulumi.String("tcp"),
    					ToPort:     pulumi.Float64(22),
    				},
    				&opentelekomcloud.ComputeSecgroupV2RuleArgs{
    					Cidr:       pulumi.String("0.0.0.0/0"),
    					FromPort:   pulumi.Float64(80),
    					IpProtocol: pulumi.String("tcp"),
    					ToPort:     pulumi.Float64(80),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var secgroup1 = new Opentelekomcloud.ComputeSecgroupV2("secgroup1", new()
        {
            Description = "my security group",
            Rules = new[]
            {
                new Opentelekomcloud.Inputs.ComputeSecgroupV2RuleArgs
                {
                    Cidr = "0.0.0.0/0",
                    FromPort = 22,
                    IpProtocol = "tcp",
                    ToPort = 22,
                },
                new Opentelekomcloud.Inputs.ComputeSecgroupV2RuleArgs
                {
                    Cidr = "0.0.0.0/0",
                    FromPort = 80,
                    IpProtocol = "tcp",
                    ToPort = 80,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.ComputeSecgroupV2;
    import com.pulumi.opentelekomcloud.ComputeSecgroupV2Args;
    import com.pulumi.opentelekomcloud.inputs.ComputeSecgroupV2RuleArgs;
    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 secgroup1 = new ComputeSecgroupV2("secgroup1", ComputeSecgroupV2Args.builder()
                .description("my security group")
                .rules(            
                    ComputeSecgroupV2RuleArgs.builder()
                        .cidr("0.0.0.0/0")
                        .fromPort(22)
                        .ipProtocol("tcp")
                        .toPort(22)
                        .build(),
                    ComputeSecgroupV2RuleArgs.builder()
                        .cidr("0.0.0.0/0")
                        .fromPort(80)
                        .ipProtocol("tcp")
                        .toPort(80)
                        .build())
                .build());
    
        }
    }
    
    resources:
      secgroup1:
        type: opentelekomcloud:ComputeSecgroupV2
        properties:
          description: my security group
          rules:
            - cidr: 0.0.0.0/0
              fromPort: 22
              ipProtocol: tcp
              toPort: 22
            - cidr: 0.0.0.0/0
              fromPort: 80
              ipProtocol: tcp
              toPort: 80
    

    Notes

    ICMP Rules

    When using ICMP as the ip_protocol, the from_port sets the ICMP type and the to_port sets the ICMP code. To allow all ICMP types, set each value to -1, like so:

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    A list of ICMP types and codes can be found here.

    Referencing Security Groups

    When referencing a security group in a configuration (for example, a configuration creates a new security group and then needs to apply it to an instance being created in the same configuration), it is currently recommended to reference the security group by name and not by ID, like this:

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const test_server = new opentelekomcloud.ComputeInstanceV2("test-server", {
        imageId: "ad091b52-742f-469e-8f3c-fd81cadf0743",
        flavorId: "3",
        keyPair: "my_key_pair_name",
        securityGroups: [opentelekomcloud_compute_secgroup_v2.secgroup_1.name],
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    test_server = opentelekomcloud.ComputeInstanceV2("test-server",
        image_id="ad091b52-742f-469e-8f3c-fd81cadf0743",
        flavor_id="3",
        key_pair="my_key_pair_name",
        security_groups=[opentelekomcloud_compute_secgroup_v2["secgroup_1"]["name"]])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opentelekomcloud.NewComputeInstanceV2(ctx, "test-server", &opentelekomcloud.ComputeInstanceV2Args{
    			ImageId:  pulumi.String("ad091b52-742f-469e-8f3c-fd81cadf0743"),
    			FlavorId: pulumi.String("3"),
    			KeyPair:  pulumi.String("my_key_pair_name"),
    			SecurityGroups: pulumi.StringArray{
    				opentelekomcloud_compute_secgroup_v2.Secgroup_1.Name,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var test_server = new Opentelekomcloud.ComputeInstanceV2("test-server", new()
        {
            ImageId = "ad091b52-742f-469e-8f3c-fd81cadf0743",
            FlavorId = "3",
            KeyPair = "my_key_pair_name",
            SecurityGroups = new[]
            {
                opentelekomcloud_compute_secgroup_v2.Secgroup_1.Name,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.ComputeInstanceV2;
    import com.pulumi.opentelekomcloud.ComputeInstanceV2Args;
    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 test_server = new ComputeInstanceV2("test-server", ComputeInstanceV2Args.builder()
                .imageId("ad091b52-742f-469e-8f3c-fd81cadf0743")
                .flavorId("3")
                .keyPair("my_key_pair_name")
                .securityGroups(opentelekomcloud_compute_secgroup_v2.secgroup_1().name())
                .build());
    
        }
    }
    
    resources:
      test-server:
        type: opentelekomcloud:ComputeInstanceV2
        properties:
          imageId: ad091b52-742f-469e-8f3c-fd81cadf0743
          flavorId: '3'
          keyPair: my_key_pair_name
          securityGroups:
            - ${opentelekomcloud_compute_secgroup_v2.secgroup_1.name}
    

    Create ComputeSecgroupV2 Resource

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

    Constructor syntax

    new ComputeSecgroupV2(name: string, args: ComputeSecgroupV2Args, opts?: CustomResourceOptions);
    @overload
    def ComputeSecgroupV2(resource_name: str,
                          args: ComputeSecgroupV2Args,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ComputeSecgroupV2(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          description: Optional[str] = None,
                          compute_secgroup_v2_id: Optional[str] = None,
                          name: Optional[str] = None,
                          region: Optional[str] = None,
                          rules: Optional[Sequence[ComputeSecgroupV2RuleArgs]] = None,
                          timeouts: Optional[ComputeSecgroupV2TimeoutsArgs] = None)
    func NewComputeSecgroupV2(ctx *Context, name string, args ComputeSecgroupV2Args, opts ...ResourceOption) (*ComputeSecgroupV2, error)
    public ComputeSecgroupV2(string name, ComputeSecgroupV2Args args, CustomResourceOptions? opts = null)
    public ComputeSecgroupV2(String name, ComputeSecgroupV2Args args)
    public ComputeSecgroupV2(String name, ComputeSecgroupV2Args args, CustomResourceOptions options)
    
    type: opentelekomcloud:ComputeSecgroupV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ComputeSecgroupV2Args
    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 ComputeSecgroupV2Args
    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 ComputeSecgroupV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ComputeSecgroupV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ComputeSecgroupV2Args
    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 computeSecgroupV2Resource = new Opentelekomcloud.ComputeSecgroupV2("computeSecgroupV2Resource", new()
    {
        Description = "string",
        ComputeSecgroupV2Id = "string",
        Name = "string",
        Region = "string",
        Rules = new[]
        {
            new Opentelekomcloud.Inputs.ComputeSecgroupV2RuleArgs
            {
                FromPort = 0,
                IpProtocol = "string",
                ToPort = 0,
                Cidr = "string",
                FromGroupId = "string",
                Id = "string",
                Self = false,
            },
        },
        Timeouts = new Opentelekomcloud.Inputs.ComputeSecgroupV2TimeoutsArgs
        {
            Delete = "string",
        },
    });
    
    example, err := opentelekomcloud.NewComputeSecgroupV2(ctx, "computeSecgroupV2Resource", &opentelekomcloud.ComputeSecgroupV2Args{
    	Description:         pulumi.String("string"),
    	ComputeSecgroupV2Id: pulumi.String("string"),
    	Name:                pulumi.String("string"),
    	Region:              pulumi.String("string"),
    	Rules: opentelekomcloud.ComputeSecgroupV2RuleArray{
    		&opentelekomcloud.ComputeSecgroupV2RuleArgs{
    			FromPort:    pulumi.Float64(0),
    			IpProtocol:  pulumi.String("string"),
    			ToPort:      pulumi.Float64(0),
    			Cidr:        pulumi.String("string"),
    			FromGroupId: pulumi.String("string"),
    			Id:          pulumi.String("string"),
    			Self:        pulumi.Bool(false),
    		},
    	},
    	Timeouts: &opentelekomcloud.ComputeSecgroupV2TimeoutsArgs{
    		Delete: pulumi.String("string"),
    	},
    })
    
    var computeSecgroupV2Resource = new ComputeSecgroupV2("computeSecgroupV2Resource", ComputeSecgroupV2Args.builder()
        .description("string")
        .computeSecgroupV2Id("string")
        .name("string")
        .region("string")
        .rules(ComputeSecgroupV2RuleArgs.builder()
            .fromPort(0)
            .ipProtocol("string")
            .toPort(0)
            .cidr("string")
            .fromGroupId("string")
            .id("string")
            .self(false)
            .build())
        .timeouts(ComputeSecgroupV2TimeoutsArgs.builder()
            .delete("string")
            .build())
        .build());
    
    compute_secgroup_v2_resource = opentelekomcloud.ComputeSecgroupV2("computeSecgroupV2Resource",
        description="string",
        compute_secgroup_v2_id="string",
        name="string",
        region="string",
        rules=[{
            "from_port": 0,
            "ip_protocol": "string",
            "to_port": 0,
            "cidr": "string",
            "from_group_id": "string",
            "id": "string",
            "self": False,
        }],
        timeouts={
            "delete": "string",
        })
    
    const computeSecgroupV2Resource = new opentelekomcloud.ComputeSecgroupV2("computeSecgroupV2Resource", {
        description: "string",
        computeSecgroupV2Id: "string",
        name: "string",
        region: "string",
        rules: [{
            fromPort: 0,
            ipProtocol: "string",
            toPort: 0,
            cidr: "string",
            fromGroupId: "string",
            id: "string",
            self: false,
        }],
        timeouts: {
            "delete": "string",
        },
    });
    
    type: opentelekomcloud:ComputeSecgroupV2
    properties:
        computeSecgroupV2Id: string
        description: string
        name: string
        region: string
        rules:
            - cidr: string
              fromGroupId: string
              fromPort: 0
              id: string
              ipProtocol: string
              self: false
              toPort: 0
        timeouts:
            delete: string
    

    ComputeSecgroupV2 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 ComputeSecgroupV2 resource accepts the following input properties:

    Description string
    A description for the security group. Changing this updates the description of an existing security group.
    ComputeSecgroupV2Id string
    Name string
    A unique name for the security group. Changing this updates the name of an existing security group.
    Region string
    Rules List<ComputeSecgroupV2Rule>
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    Timeouts ComputeSecgroupV2Timeouts
    Description string
    A description for the security group. Changing this updates the description of an existing security group.
    ComputeSecgroupV2Id string
    Name string
    A unique name for the security group. Changing this updates the name of an existing security group.
    Region string
    Rules []ComputeSecgroupV2RuleArgs
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    Timeouts ComputeSecgroupV2TimeoutsArgs
    description String
    A description for the security group. Changing this updates the description of an existing security group.
    computeSecgroupV2Id String
    name String
    A unique name for the security group. Changing this updates the name of an existing security group.
    region String
    rules List<ComputeSecgroupV2Rule>
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts ComputeSecgroupV2Timeouts
    description string
    A description for the security group. Changing this updates the description of an existing security group.
    computeSecgroupV2Id string
    name string
    A unique name for the security group. Changing this updates the name of an existing security group.
    region string
    rules ComputeSecgroupV2Rule[]
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts ComputeSecgroupV2Timeouts
    description str
    A description for the security group. Changing this updates the description of an existing security group.
    compute_secgroup_v2_id str
    name str
    A unique name for the security group. Changing this updates the name of an existing security group.
    region str
    rules Sequence[ComputeSecgroupV2RuleArgs]
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts ComputeSecgroupV2TimeoutsArgs
    description String
    A description for the security group. Changing this updates the description of an existing security group.
    computeSecgroupV2Id String
    name String
    A unique name for the security group. Changing this updates the name of an existing security group.
    region String
    rules List<Property Map>
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ComputeSecgroupV2 Resource

    Get an existing ComputeSecgroupV2 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?: ComputeSecgroupV2State, opts?: CustomResourceOptions): ComputeSecgroupV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compute_secgroup_v2_id: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            rules: Optional[Sequence[ComputeSecgroupV2RuleArgs]] = None,
            timeouts: Optional[ComputeSecgroupV2TimeoutsArgs] = None) -> ComputeSecgroupV2
    func GetComputeSecgroupV2(ctx *Context, name string, id IDInput, state *ComputeSecgroupV2State, opts ...ResourceOption) (*ComputeSecgroupV2, error)
    public static ComputeSecgroupV2 Get(string name, Input<string> id, ComputeSecgroupV2State? state, CustomResourceOptions? opts = null)
    public static ComputeSecgroupV2 get(String name, Output<String> id, ComputeSecgroupV2State state, CustomResourceOptions options)
    resources:  _:    type: opentelekomcloud:ComputeSecgroupV2    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ComputeSecgroupV2Id string
    Description string
    A description for the security group. Changing this updates the description of an existing security group.
    Name string
    A unique name for the security group. Changing this updates the name of an existing security group.
    Region string
    Rules List<ComputeSecgroupV2Rule>
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    Timeouts ComputeSecgroupV2Timeouts
    ComputeSecgroupV2Id string
    Description string
    A description for the security group. Changing this updates the description of an existing security group.
    Name string
    A unique name for the security group. Changing this updates the name of an existing security group.
    Region string
    Rules []ComputeSecgroupV2RuleArgs
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    Timeouts ComputeSecgroupV2TimeoutsArgs
    computeSecgroupV2Id String
    description String
    A description for the security group. Changing this updates the description of an existing security group.
    name String
    A unique name for the security group. Changing this updates the name of an existing security group.
    region String
    rules List<ComputeSecgroupV2Rule>
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts ComputeSecgroupV2Timeouts
    computeSecgroupV2Id string
    description string
    A description for the security group. Changing this updates the description of an existing security group.
    name string
    A unique name for the security group. Changing this updates the name of an existing security group.
    region string
    rules ComputeSecgroupV2Rule[]
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts ComputeSecgroupV2Timeouts
    compute_secgroup_v2_id str
    description str
    A description for the security group. Changing this updates the description of an existing security group.
    name str
    A unique name for the security group. Changing this updates the name of an existing security group.
    region str
    rules Sequence[ComputeSecgroupV2RuleArgs]
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts ComputeSecgroupV2TimeoutsArgs
    computeSecgroupV2Id String
    description String
    A description for the security group. Changing this updates the description of an existing security group.
    name String
    A unique name for the security group. Changing this updates the name of an existing security group.
    region String
    rules List<Property Map>
    A rule describing how the security group operates. The rule object structure is documented below. Changing this updates the security group rules. As shown in the example above, multiple rule blocks may be used.
    timeouts Property Map

    Supporting Types

    ComputeSecgroupV2Rule, ComputeSecgroupV2RuleArgs

    FromPort double
    An integer representing the lower bound of the port range to open. Changing this creates a new security group rule.
    IpProtocol string
    The protocol type that will be allowed. Changing this creates a new security group rule.
    ToPort double
    An integer representing the upper bound of the port range to open. Changing this creates a new security group rule.
    Cidr string
    Required if from_group_id or self is empty. The IP range that will be the source of network traffic to the security group. Use 0.0.0.0/0 to allow all IP addresses. Changing this creates a new security group rule. Cannot be combined with from_group_id or self.
    FromGroupId string
    Required if cidr or self is empty. The ID of a group from which to forward traffic to the parent group. Changing this creates a new security group rule. Cannot be combined with cidr or self.
    Id string
    Self bool
    Required if cidr and from_group_id is empty. If true, the security group itself will be added as a source to this ingress rule. Cannot be combined with cidr or from_group_id.
    FromPort float64
    An integer representing the lower bound of the port range to open. Changing this creates a new security group rule.
    IpProtocol string
    The protocol type that will be allowed. Changing this creates a new security group rule.
    ToPort float64
    An integer representing the upper bound of the port range to open. Changing this creates a new security group rule.
    Cidr string
    Required if from_group_id or self is empty. The IP range that will be the source of network traffic to the security group. Use 0.0.0.0/0 to allow all IP addresses. Changing this creates a new security group rule. Cannot be combined with from_group_id or self.
    FromGroupId string
    Required if cidr or self is empty. The ID of a group from which to forward traffic to the parent group. Changing this creates a new security group rule. Cannot be combined with cidr or self.
    Id string
    Self bool
    Required if cidr and from_group_id is empty. If true, the security group itself will be added as a source to this ingress rule. Cannot be combined with cidr or from_group_id.
    fromPort Double
    An integer representing the lower bound of the port range to open. Changing this creates a new security group rule.
    ipProtocol String
    The protocol type that will be allowed. Changing this creates a new security group rule.
    toPort Double
    An integer representing the upper bound of the port range to open. Changing this creates a new security group rule.
    cidr String
    Required if from_group_id or self is empty. The IP range that will be the source of network traffic to the security group. Use 0.0.0.0/0 to allow all IP addresses. Changing this creates a new security group rule. Cannot be combined with from_group_id or self.
    fromGroupId String
    Required if cidr or self is empty. The ID of a group from which to forward traffic to the parent group. Changing this creates a new security group rule. Cannot be combined with cidr or self.
    id String
    self Boolean
    Required if cidr and from_group_id is empty. If true, the security group itself will be added as a source to this ingress rule. Cannot be combined with cidr or from_group_id.
    fromPort number
    An integer representing the lower bound of the port range to open. Changing this creates a new security group rule.
    ipProtocol string
    The protocol type that will be allowed. Changing this creates a new security group rule.
    toPort number
    An integer representing the upper bound of the port range to open. Changing this creates a new security group rule.
    cidr string
    Required if from_group_id or self is empty. The IP range that will be the source of network traffic to the security group. Use 0.0.0.0/0 to allow all IP addresses. Changing this creates a new security group rule. Cannot be combined with from_group_id or self.
    fromGroupId string
    Required if cidr or self is empty. The ID of a group from which to forward traffic to the parent group. Changing this creates a new security group rule. Cannot be combined with cidr or self.
    id string
    self boolean
    Required if cidr and from_group_id is empty. If true, the security group itself will be added as a source to this ingress rule. Cannot be combined with cidr or from_group_id.
    from_port float
    An integer representing the lower bound of the port range to open. Changing this creates a new security group rule.
    ip_protocol str
    The protocol type that will be allowed. Changing this creates a new security group rule.
    to_port float
    An integer representing the upper bound of the port range to open. Changing this creates a new security group rule.
    cidr str
    Required if from_group_id or self is empty. The IP range that will be the source of network traffic to the security group. Use 0.0.0.0/0 to allow all IP addresses. Changing this creates a new security group rule. Cannot be combined with from_group_id or self.
    from_group_id str
    Required if cidr or self is empty. The ID of a group from which to forward traffic to the parent group. Changing this creates a new security group rule. Cannot be combined with cidr or self.
    id str
    self bool
    Required if cidr and from_group_id is empty. If true, the security group itself will be added as a source to this ingress rule. Cannot be combined with cidr or from_group_id.
    fromPort Number
    An integer representing the lower bound of the port range to open. Changing this creates a new security group rule.
    ipProtocol String
    The protocol type that will be allowed. Changing this creates a new security group rule.
    toPort Number
    An integer representing the upper bound of the port range to open. Changing this creates a new security group rule.
    cidr String
    Required if from_group_id or self is empty. The IP range that will be the source of network traffic to the security group. Use 0.0.0.0/0 to allow all IP addresses. Changing this creates a new security group rule. Cannot be combined with from_group_id or self.
    fromGroupId String
    Required if cidr or self is empty. The ID of a group from which to forward traffic to the parent group. Changing this creates a new security group rule. Cannot be combined with cidr or self.
    id String
    self Boolean
    Required if cidr and from_group_id is empty. If true, the security group itself will be added as a source to this ingress rule. Cannot be combined with cidr or from_group_id.

    ComputeSecgroupV2Timeouts, ComputeSecgroupV2TimeoutsArgs

    Delete string
    Delete string
    delete String
    delete string
    delete str
    delete String

    Import

    Security Groups can be imported using the id, e.g.

    $ pulumi import opentelekomcloud:index/computeSecgroupV2:ComputeSecgroupV2 my_secgroup 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf
    

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

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    opentelekomcloud logo
    opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud