1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. getNetworkingSecgroupRuleIdsV2
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud

opentelekomcloud.getNetworkingSecgroupRuleIdsV2

Explore with Pulumi AI

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

Use this data source to get a list of security group rules ids for a security_group_id.

This resource can be useful for getting back a list of security group rules ids for a Security Group.

Example Usage

The following example shows outputting all security group rules for security group.

import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";

const config = new pulumi.Config();
const securityGroupId = config.requireObject("securityGroupId");
const sgIds = opentelekomcloud.getNetworkingSecgroupRuleIdsV2({
    securityGroupId: securityGroupId,
});
export const secgroupRuleIds = sgIds.then(sgIds => .map(id => (id)));
Copy
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud

config = pulumi.Config()
security_group_id = config.require_object("securityGroupId")
sg_ids = opentelekomcloud.get_networking_secgroup_rule_ids_v2(security_group_id=security_group_id)
pulumi.export("secgroupRuleIds", [id for id in sg_ids.ids])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		securityGroupId := cfg.RequireObject("securityGroupId")
		sgIds, err := opentelekomcloud.GetNetworkingSecgroupRuleIdsV2(ctx, &opentelekomcloud.GetNetworkingSecgroupRuleIdsV2Args{
			SecurityGroupId: securityGroupId,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("secgroupRuleIds", pulumi.StringArray("TODO: For expression"))
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var securityGroupId = config.RequireObject<dynamic>("securityGroupId");
    var sgIds = Opentelekomcloud.GetNetworkingSecgroupRuleIdsV2.Invoke(new()
    {
        SecurityGroupId = securityGroupId,
    });

    return new Dictionary<string, object?>
    {
        ["secgroupRuleIds"] = .Select(id => 
        {
            return id;
        }).ToList(),
    };
});
Copy
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.GetNetworkingSecgroupRuleIdsV2Args;
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 config = ctx.config();
        final var securityGroupId = config.get("securityGroupId");
        final var sgIds = OpentelekomcloudFunctions.getNetworkingSecgroupRuleIdsV2(GetNetworkingSecgroupRuleIdsV2Args.builder()
            .securityGroupId(securityGroupId)
            .build());

        ctx.export("secgroupRuleIds", "TODO: ForExpression");
    }
}
Copy
Coming soon!

Using getNetworkingSecgroupRuleIdsV2

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 getNetworkingSecgroupRuleIdsV2(args: GetNetworkingSecgroupRuleIdsV2Args, opts?: InvokeOptions): Promise<GetNetworkingSecgroupRuleIdsV2Result>
function getNetworkingSecgroupRuleIdsV2Output(args: GetNetworkingSecgroupRuleIdsV2OutputArgs, opts?: InvokeOptions): Output<GetNetworkingSecgroupRuleIdsV2Result>
Copy
def get_networking_secgroup_rule_ids_v2(id: Optional[str] = None,
                                        region: Optional[str] = None,
                                        security_group_id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetNetworkingSecgroupRuleIdsV2Result
def get_networking_secgroup_rule_ids_v2_output(id: Optional[pulumi.Input[str]] = None,
                                        region: Optional[pulumi.Input[str]] = None,
                                        security_group_id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetNetworkingSecgroupRuleIdsV2Result]
Copy
func GetNetworkingSecgroupRuleIdsV2(ctx *Context, args *GetNetworkingSecgroupRuleIdsV2Args, opts ...InvokeOption) (*GetNetworkingSecgroupRuleIdsV2Result, error)
func GetNetworkingSecgroupRuleIdsV2Output(ctx *Context, args *GetNetworkingSecgroupRuleIdsV2OutputArgs, opts ...InvokeOption) GetNetworkingSecgroupRuleIdsV2ResultOutput
Copy

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

public static class GetNetworkingSecgroupRuleIdsV2 
{
    public static Task<GetNetworkingSecgroupRuleIdsV2Result> InvokeAsync(GetNetworkingSecgroupRuleIdsV2Args args, InvokeOptions? opts = null)
    public static Output<GetNetworkingSecgroupRuleIdsV2Result> Invoke(GetNetworkingSecgroupRuleIdsV2InvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNetworkingSecgroupRuleIdsV2Result> getNetworkingSecgroupRuleIdsV2(GetNetworkingSecgroupRuleIdsV2Args args, InvokeOptions options)
public static Output<GetNetworkingSecgroupRuleIdsV2Result> getNetworkingSecgroupRuleIdsV2(GetNetworkingSecgroupRuleIdsV2Args args, InvokeOptions options)
Copy
fn::invoke:
  function: opentelekomcloud:index/getNetworkingSecgroupRuleIdsV2:getNetworkingSecgroupRuleIdsV2
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

SecurityGroupId This property is required. string
Specifies the security group ID used as the query filter.
Id string
Region string
SecurityGroupId This property is required. string
Specifies the security group ID used as the query filter.
Id string
Region string
securityGroupId This property is required. String
Specifies the security group ID used as the query filter.
id String
region String
securityGroupId This property is required. string
Specifies the security group ID used as the query filter.
id string
region string
security_group_id This property is required. str
Specifies the security group ID used as the query filter.
id str
region str
securityGroupId This property is required. String
Specifies the security group ID used as the query filter.
id String
region String

getNetworkingSecgroupRuleIdsV2 Result

The following output properties are available:

Id string
Ids List<string>
A list of all the security group rule IDs found. This data source will fail if none are found.
Region string
SecurityGroupId string
Id string
Ids []string
A list of all the security group rule IDs found. This data source will fail if none are found.
Region string
SecurityGroupId string
id String
ids List<String>
A list of all the security group rule IDs found. This data source will fail if none are found.
region String
securityGroupId String
id string
ids string[]
A list of all the security group rule IDs found. This data source will fail if none are found.
region string
securityGroupId string
id str
ids Sequence[str]
A list of all the security group rule IDs found. This data source will fail if none are found.
region str
security_group_id str
id String
ids List<String>
A list of all the security group rule IDs found. This data source will fail if none are found.
region String
securityGroupId String

Package Details

Repository
opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
License
Notes
This Pulumi package is based on the opentelekomcloud Terraform Provider.