Viewing docs for ucloud 1.39.5
published on Thursday, May 14, 2026 by ucloud
published on Thursday, May 14, 2026 by ucloud
Viewing docs for ucloud 1.39.5
published on Thursday, May 14, 2026 by ucloud
published on Thursday, May 14, 2026 by ucloud
This data source provides a list of Security Group resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = ucloud.getSecGroups({
vpcId: "uvnet-xxxxx",
});
export const first = example.then(example => example.secGroups?.[0]?.id);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_sec_groups(vpc_id="uvnet-xxxxx")
pulumi.export("first", example.sec_groups[0].id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ucloud.GetSecGroups(ctx, &ucloud.GetSecGroupsArgs{
VpcId: pulumi.StringRef("uvnet-xxxxx"),
}, nil)
if err != nil {
return err
}
ctx.Export("first", example.SecGroups[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var example = Ucloud.GetSecGroups.Invoke(new()
{
VpcId = "uvnet-xxxxx",
});
return new Dictionary<string, object?>
{
["first"] = example.Apply(getSecGroupsResult => getSecGroupsResult.SecGroups[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetSecGroupsArgs;
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 example = UcloudFunctions.getSecGroups(GetSecGroupsArgs.builder()
.vpcId("uvnet-xxxxx")
.build());
ctx.export("first", example.secGroups()[0].id());
}
}
variables:
example:
fn::invoke:
function: ucloud:getSecGroups
arguments:
vpcId: uvnet-xxxxx
outputs:
first: ${example.secGroups[0].id}
Example coming soon!
Using getSecGroups
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 getSecGroups(args: GetSecGroupsArgs, opts?: InvokeOptions): Promise<GetSecGroupsResult>
function getSecGroupsOutput(args: GetSecGroupsOutputArgs, opts?: InvokeOptions): Output<GetSecGroupsResult>def get_sec_groups(id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
vpc_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecGroupsResult
def get_sec_groups_output(id: pulumi.Input[Optional[str]] = None,
ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
name_regex: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
vpc_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecGroupsResult]func GetSecGroups(ctx *Context, args *GetSecGroupsArgs, opts ...InvokeOption) (*GetSecGroupsResult, error)
func GetSecGroupsOutput(ctx *Context, args *GetSecGroupsOutputArgs, opts ...InvokeOption) GetSecGroupsResultOutput> Note: This function is named GetSecGroups in the Go SDK.
public static class GetSecGroups
{
public static Task<GetSecGroupsResult> InvokeAsync(GetSecGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetSecGroupsResult> Invoke(GetSecGroupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSecGroupsResult> getSecGroups(GetSecGroupsArgs args, InvokeOptions options)
public static Output<GetSecGroupsResult> getSecGroups(GetSecGroupsArgs args, InvokeOptions options)
fn::invoke:
function: ucloud:index/getSecGroups:getSecGroups
arguments:
# arguments dictionarydata "ucloud_getsecgroups" "name" {
# arguments
}The following arguments are supported:
- Id string
- The ID of the security group.
- Ids List<string>
- A list of security group IDs to filter.
- Name
Regex string - A regex string to filter results by security group name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Vpc
Id string - The ID of VPC to filter security groups.
- Id string
- The ID of the security group.
- Ids []string
- A list of security group IDs to filter.
- Name
Regex string - A regex string to filter results by security group name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Vpc
Id string - The ID of VPC to filter security groups.
- id string
- The ID of the security group.
- ids list(string)
- A list of security group IDs to filter.
- name_
regex string - A regex string to filter results by security group name.
- output_
file string - File name where to save data source results (after running
pulumi preview). - vpc_
id string - The ID of VPC to filter security groups.
- id String
- The ID of the security group.
- ids List<String>
- A list of security group IDs to filter.
- name
Regex String - A regex string to filter results by security group name.
- output
File String - File name where to save data source results (after running
pulumi preview). - vpc
Id String - The ID of VPC to filter security groups.
- id string
- The ID of the security group.
- ids string[]
- A list of security group IDs to filter.
- name
Regex string - A regex string to filter results by security group name.
- output
File string - File name where to save data source results (after running
pulumi preview). - vpc
Id string - The ID of VPC to filter security groups.
- id str
- The ID of the security group.
- ids Sequence[str]
- A list of security group IDs to filter.
- name_
regex str - A regex string to filter results by security group name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - vpc_
id str - The ID of VPC to filter security groups.
- id String
- The ID of the security group.
- ids List<String>
- A list of security group IDs to filter.
- name
Regex String - A regex string to filter results by security group name.
- output
File String - File name where to save data source results (after running
pulumi preview). - vpc
Id String - The ID of VPC to filter security groups.
getSecGroups Result
The following output properties are available:
- Id string
- The ID of the security group.
- Ids List<string>
- A list of security group IDs.
- Sec
Groups List<GetSec Groups Sec Group> - It is a nested type which documented below.
- Total
Count double - Total number of security groups that satisfy the condition.
- Name
Regex string - Output
File string - Vpc
Id string - The ID of VPC linked to the security group.
- Id string
- The ID of the security group.
- Ids []string
- A list of security group IDs.
- Sec
Groups []GetSec Groups Sec Group - It is a nested type which documented below.
- Total
Count float64 - Total number of security groups that satisfy the condition.
- Name
Regex string - Output
File string - Vpc
Id string - The ID of VPC linked to the security group.
- id string
- The ID of the security group.
- ids list(string)
- A list of security group IDs.
- sec_
groups list(object) - It is a nested type which documented below.
- total_
count number - Total number of security groups that satisfy the condition.
- name_
regex string - output_
file string - vpc_
id string - The ID of VPC linked to the security group.
- id String
- The ID of the security group.
- ids List<String>
- A list of security group IDs.
- sec
Groups List<GetSec Groups Sec Group> - It is a nested type which documented below.
- total
Count Double - Total number of security groups that satisfy the condition.
- name
Regex String - output
File String - vpc
Id String - The ID of VPC linked to the security group.
- id string
- The ID of the security group.
- ids string[]
- A list of security group IDs.
- sec
Groups GetSec Groups Sec Group[] - It is a nested type which documented below.
- total
Count number - Total number of security groups that satisfy the condition.
- name
Regex string - output
File string - vpc
Id string - The ID of VPC linked to the security group.
- id str
- The ID of the security group.
- ids Sequence[str]
- A list of security group IDs.
- sec_
groups Sequence[GetSec Groups Sec Group] - It is a nested type which documented below.
- total_
count float - Total number of security groups that satisfy the condition.
- name_
regex str - output_
file str - vpc_
id str - The ID of VPC linked to the security group.
- id String
- The ID of the security group.
- ids List<String>
- A list of security group IDs.
- sec
Groups List<Property Map> - It is a nested type which documented below.
- total
Count Number - Total number of security groups that satisfy the condition.
- name
Regex String - output
File String - vpc
Id String - The ID of VPC linked to the security group.
Supporting Types
GetSecGroupsSecGroup
- Create
Time string - The time of creation, formatted in RFC3339 time string.
- Id string
- The ID of the security group.
- Name string
- The name of the security group.
- Remark string
- The remarks of the rule.
- Rules
List<Get
Sec Groups Sec Group Rule> - A list of security group rules. Each element contains the following attributes:
- Tag string
- A tag assigned to the security group.
- Type string
- The type of the security group.
- Vpc
Id string - The ID of VPC to filter security groups.
- Create
Time string - The time of creation, formatted in RFC3339 time string.
- Id string
- The ID of the security group.
- Name string
- The name of the security group.
- Remark string
- The remarks of the rule.
- Rules
[]Get
Sec Groups Sec Group Rule - A list of security group rules. Each element contains the following attributes:
- Tag string
- A tag assigned to the security group.
- Type string
- The type of the security group.
- Vpc
Id string - The ID of VPC to filter security groups.
- create_
time string - The time of creation, formatted in RFC3339 time string.
- id string
- The ID of the security group.
- name string
- The name of the security group.
- remark string
- The remarks of the rule.
- rules list(object)
- A list of security group rules. Each element contains the following attributes:
- tag string
- A tag assigned to the security group.
- type string
- The type of the security group.
- vpc_
id string - The ID of VPC to filter security groups.
- create
Time String - The time of creation, formatted in RFC3339 time string.
- id String
- The ID of the security group.
- name String
- The name of the security group.
- remark String
- The remarks of the rule.
- rules
List<Get
Sec Groups Sec Group Rule> - A list of security group rules. Each element contains the following attributes:
- tag String
- A tag assigned to the security group.
- type String
- The type of the security group.
- vpc
Id String - The ID of VPC to filter security groups.
- create
Time string - The time of creation, formatted in RFC3339 time string.
- id string
- The ID of the security group.
- name string
- The name of the security group.
- remark string
- The remarks of the rule.
- rules
Get
Sec Groups Sec Group Rule[] - A list of security group rules. Each element contains the following attributes:
- tag string
- A tag assigned to the security group.
- type string
- The type of the security group.
- vpc
Id string - The ID of VPC to filter security groups.
- create_
time str - The time of creation, formatted in RFC3339 time string.
- id str
- The ID of the security group.
- name str
- The name of the security group.
- remark str
- The remarks of the rule.
- rules
Sequence[Get
Sec Groups Sec Group Rule] - A list of security group rules. Each element contains the following attributes:
- tag str
- A tag assigned to the security group.
- type str
- The type of the security group.
- vpc_
id str - The ID of VPC to filter security groups.
- create
Time String - The time of creation, formatted in RFC3339 time string.
- id String
- The ID of the security group.
- name String
- The name of the security group.
- remark String
- The remarks of the rule.
- rules List<Property Map>
- A list of security group rules. Each element contains the following attributes:
- tag String
- A tag assigned to the security group.
- type String
- The type of the security group.
- vpc
Id String - The ID of VPC to filter security groups.
GetSecGroupsSecGroupRule
- Direction string
- The direction of the rule.
- Dst
Port string - The destination port.
- Ip
Range string - The IP address range.
- Priority double
- The priority of the rule.
- Protocol
Type string - The protocol type.
- Remark string
- The remarks of the rule.
- Rule
Action string - The action of the rule.
- Rule
Id string - The ID of the rule.
- Direction string
- The direction of the rule.
- Dst
Port string - The destination port.
- Ip
Range string - The IP address range.
- Priority float64
- The priority of the rule.
- Protocol
Type string - The protocol type.
- Remark string
- The remarks of the rule.
- Rule
Action string - The action of the rule.
- Rule
Id string - The ID of the rule.
- direction string
- The direction of the rule.
- dst_
port string - The destination port.
- ip_
range string - The IP address range.
- priority number
- The priority of the rule.
- protocol_
type string - The protocol type.
- remark string
- The remarks of the rule.
- rule_
action string - The action of the rule.
- rule_
id string - The ID of the rule.
- direction String
- The direction of the rule.
- dst
Port String - The destination port.
- ip
Range String - The IP address range.
- priority Double
- The priority of the rule.
- protocol
Type String - The protocol type.
- remark String
- The remarks of the rule.
- rule
Action String - The action of the rule.
- rule
Id String - The ID of the rule.
- direction string
- The direction of the rule.
- dst
Port string - The destination port.
- ip
Range string - The IP address range.
- priority number
- The priority of the rule.
- protocol
Type string - The protocol type.
- remark string
- The remarks of the rule.
- rule
Action string - The action of the rule.
- rule
Id string - The ID of the rule.
- direction str
- The direction of the rule.
- dst_
port str - The destination port.
- ip_
range str - The IP address range.
- priority float
- The priority of the rule.
- protocol_
type str - The protocol type.
- remark str
- The remarks of the rule.
- rule_
action str - The action of the rule.
- rule_
id str - The ID of the rule.
- direction String
- The direction of the rule.
- dst
Port String - The destination port.
- ip
Range String - The IP address range.
- priority Number
- The priority of the rule.
- protocol
Type String - The protocol type.
- remark String
- The remarks of the rule.
- rule
Action String - The action of the rule.
- rule
Id String - The ID of the rule.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloudTerraform Provider.
Viewing docs for ucloud 1.39.5
published on Thursday, May 14, 2026 by ucloud
published on Thursday, May 14, 2026 by ucloud
