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

opentelekomcloud.getNetworkingSecgroupV2

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 Network security group you can get at documentation portal

    Use this data source to get the ID of an available OpenTelekomCloud security group.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const secgroup = opentelekomcloud.getNetworkingSecgroupV2({
        name: "tf_test_secgroup",
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    secgroup = opentelekomcloud.get_networking_secgroup_v2(name="tf_test_secgroup")
    
    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.LookupNetworkingSecgroupV2(ctx, &opentelekomcloud.LookupNetworkingSecgroupV2Args{
    			Name: pulumi.StringRef("tf_test_secgroup"),
    		}, nil)
    		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 secgroup = Opentelekomcloud.GetNetworkingSecgroupV2.Invoke(new()
        {
            Name = "tf_test_secgroup",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.OpentelekomcloudFunctions;
    import com.pulumi.opentelekomcloud.inputs.GetNetworkingSecgroupV2Args;
    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 secgroup = OpentelekomcloudFunctions.getNetworkingSecgroupV2(GetNetworkingSecgroupV2Args.builder()
                .name("tf_test_secgroup")
                .build());
    
        }
    }
    
    variables:
      secgroup:
        fn::invoke:
          function: opentelekomcloud:getNetworkingSecgroupV2
          arguments:
            name: tf_test_secgroup
    

    Example Filter by regex

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const secgroup1 = opentelekomcloud.getNetworkingSecgroupV2({
        nameRegex: "^secgroup_1.+",
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    secgroup1 = opentelekomcloud.get_networking_secgroup_v2(name_regex="^secgroup_1.+")
    
    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.LookupNetworkingSecgroupV2(ctx, &opentelekomcloud.LookupNetworkingSecgroupV2Args{
    			NameRegex: pulumi.StringRef("^secgroup_1.+"),
    		}, nil)
    		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 = Opentelekomcloud.GetNetworkingSecgroupV2.Invoke(new()
        {
            NameRegex = "^secgroup_1.+",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.OpentelekomcloudFunctions;
    import com.pulumi.opentelekomcloud.inputs.GetNetworkingSecgroupV2Args;
    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 secgroup1 = OpentelekomcloudFunctions.getNetworkingSecgroupV2(GetNetworkingSecgroupV2Args.builder()
                .nameRegex("^secgroup_1.+")
                .build());
    
        }
    }
    
    variables:
      secgroup1:
        fn::invoke:
          function: opentelekomcloud:getNetworkingSecgroupV2
          arguments:
            nameRegex: ^secgroup_1.+
    

    Using getNetworkingSecgroupV2

    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 getNetworkingSecgroupV2(args: GetNetworkingSecgroupV2Args, opts?: InvokeOptions): Promise<GetNetworkingSecgroupV2Result>
    function getNetworkingSecgroupV2Output(args: GetNetworkingSecgroupV2OutputArgs, opts?: InvokeOptions): Output<GetNetworkingSecgroupV2Result>
    def get_networking_secgroup_v2(id: Optional[str] = None,
                                   name: Optional[str] = None,
                                   name_regex: Optional[str] = None,
                                   region: Optional[str] = None,
                                   secgroup_id: Optional[str] = None,
                                   tenant_id: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetNetworkingSecgroupV2Result
    def get_networking_secgroup_v2_output(id: Optional[pulumi.Input[str]] = None,
                                   name: Optional[pulumi.Input[str]] = None,
                                   name_regex: Optional[pulumi.Input[str]] = None,
                                   region: Optional[pulumi.Input[str]] = None,
                                   secgroup_id: Optional[pulumi.Input[str]] = None,
                                   tenant_id: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetNetworkingSecgroupV2Result]
    func LookupNetworkingSecgroupV2(ctx *Context, args *LookupNetworkingSecgroupV2Args, opts ...InvokeOption) (*LookupNetworkingSecgroupV2Result, error)
    func LookupNetworkingSecgroupV2Output(ctx *Context, args *LookupNetworkingSecgroupV2OutputArgs, opts ...InvokeOption) LookupNetworkingSecgroupV2ResultOutput

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

    public static class GetNetworkingSecgroupV2 
    {
        public static Task<GetNetworkingSecgroupV2Result> InvokeAsync(GetNetworkingSecgroupV2Args args, InvokeOptions? opts = null)
        public static Output<GetNetworkingSecgroupV2Result> Invoke(GetNetworkingSecgroupV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetworkingSecgroupV2Result> getNetworkingSecgroupV2(GetNetworkingSecgroupV2Args args, InvokeOptions options)
    public static Output<GetNetworkingSecgroupV2Result> getNetworkingSecgroupV2(GetNetworkingSecgroupV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: opentelekomcloud:index/getNetworkingSecgroupV2:getNetworkingSecgroupV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Name string
    The name of the security group.
    NameRegex string
    A regex string to apply to the security group list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    Region string
    SecgroupId string
    The ID of the security group.
    TenantId string
    The owner of the security group.
    Id string
    Name string
    The name of the security group.
    NameRegex string
    A regex string to apply to the security group list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    Region string
    SecgroupId string
    The ID of the security group.
    TenantId string
    The owner of the security group.
    id String
    name String
    The name of the security group.
    nameRegex String
    A regex string to apply to the security group list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region String
    secgroupId String
    The ID of the security group.
    tenantId String
    The owner of the security group.
    id string
    name string
    The name of the security group.
    nameRegex string
    A regex string to apply to the security group list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region string
    secgroupId string
    The ID of the security group.
    tenantId string
    The owner of the security group.
    id str
    name str
    The name of the security group.
    name_regex str
    A regex string to apply to the security group list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region str
    secgroup_id str
    The ID of the security group.
    tenant_id str
    The owner of the security group.
    id String
    name String
    The name of the security group.
    nameRegex String
    A regex string to apply to the security group list. This allows more advanced filtering not supported from the OpenTelekomCloud API. This filtering is done locally on what OpenTelekomCloud returns.
    region String
    secgroupId String
    The ID of the security group.
    tenantId String
    The owner of the security group.

    getNetworkingSecgroupV2 Result

    The following output properties are available:

    Description string
    The description of the security group.
    Id string
    Region string
    TenantId string
    Name string
    See Argument Reference above.
    NameRegex string
    SecgroupId string
    Description string
    The description of the security group.
    Id string
    Region string
    TenantId string
    Name string
    See Argument Reference above.
    NameRegex string
    SecgroupId string
    description String
    The description of the security group.
    id String
    region String
    tenantId String
    name String
    See Argument Reference above.
    nameRegex String
    secgroupId String
    description string
    The description of the security group.
    id string
    region string
    tenantId string
    name string
    See Argument Reference above.
    nameRegex string
    secgroupId string
    description str
    The description of the security group.
    id str
    region str
    tenant_id str
    name str
    See Argument Reference above.
    name_regex str
    secgroup_id str
    description String
    The description of the security group.
    id String
    region String
    tenantId String
    name String
    See Argument Reference above.
    nameRegex String
    secgroupId String

    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