tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getSecurityGroups
Explore with Pulumi AI
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
Use this data source to query detailed information of security groups.
Example Usage
Query all security groups
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = tencentcloud.getSecurityGroups({});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.get_security_groups()
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.GetSecurityGroups(ctx, &tencentcloud.GetSecurityGroupsArgs{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = Tencentcloud.GetSecurityGroups.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetSecurityGroupsArgs;
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 = TencentcloudFunctions.getSecurityGroups();
}
}
variables:
example:
fn::invoke:
function: tencentcloud:getSecurityGroups
arguments: {}
Query security groups by filter
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = tencentcloud.getSecurityGroups({
tags: {
createBy: "Terraform",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.get_security_groups(tags={
"createBy": "Terraform",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.GetSecurityGroups(ctx, &tencentcloud.GetSecurityGroupsArgs{
Tags: map[string]interface{}{
"createBy": "Terraform",
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = Tencentcloud.GetSecurityGroups.Invoke(new()
{
Tags =
{
{ "createBy", "Terraform" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetSecurityGroupsArgs;
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 = TencentcloudFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
.tags(Map.of("createBy", "Terraform"))
.build());
}
}
variables:
example:
fn::invoke:
function: tencentcloud:getSecurityGroups
arguments:
tags:
createBy: Terraform
Using getSecurityGroups
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 getSecurityGroups(args: GetSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetSecurityGroupsResult>
function getSecurityGroupsOutput(args: GetSecurityGroupsOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupsResult>
def get_security_groups(id: Optional[str] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
result_output_file: Optional[str] = None,
security_group_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetSecurityGroupsResult
def get_security_groups_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[float]] = None,
result_output_file: Optional[pulumi.Input[str]] = None,
security_group_id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupsResult]
func GetSecurityGroups(ctx *Context, args *GetSecurityGroupsArgs, opts ...InvokeOption) (*GetSecurityGroupsResult, error)
func GetSecurityGroupsOutput(ctx *Context, args *GetSecurityGroupsOutputArgs, opts ...InvokeOption) GetSecurityGroupsResultOutput
> Note: This function is named GetSecurityGroups
in the Go SDK.
public static class GetSecurityGroups
{
public static Task<GetSecurityGroupsResult> InvokeAsync(GetSecurityGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetSecurityGroupsResult> Invoke(GetSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
public static Output<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
fn::invoke:
function: tencentcloud:index/getSecurityGroups:getSecurityGroups
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- Name string
- Name of the security group to be queried. Conflict with
security_group_id
. - Project
Id double - Project ID of the security group to be queried. Conflict with
security_group_id
. - Result
Output stringFile - Used to save results.
- Security
Group stringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - Dictionary<string, string>
- Tags of the security group to be queried. Conflict with
security_group_id
.
- Id string
- Name string
- Name of the security group to be queried. Conflict with
security_group_id
. - Project
Id float64 - Project ID of the security group to be queried. Conflict with
security_group_id
. - Result
Output stringFile - Used to save results.
- Security
Group stringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - map[string]string
- Tags of the security group to be queried. Conflict with
security_group_id
.
- id String
- name String
- Name of the security group to be queried. Conflict with
security_group_id
. - project
Id Double - Project ID of the security group to be queried. Conflict with
security_group_id
. - result
Output StringFile - Used to save results.
- security
Group StringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - Map<String,String>
- Tags of the security group to be queried. Conflict with
security_group_id
.
- id string
- name string
- Name of the security group to be queried. Conflict with
security_group_id
. - project
Id number - Project ID of the security group to be queried. Conflict with
security_group_id
. - result
Output stringFile - Used to save results.
- security
Group stringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - {[key: string]: string}
- Tags of the security group to be queried. Conflict with
security_group_id
.
- id str
- name str
- Name of the security group to be queried. Conflict with
security_group_id
. - project_
id float - Project ID of the security group to be queried. Conflict with
security_group_id
. - result_
output_ strfile - Used to save results.
- security_
group_ strid - ID of the security group to be queried. Conflict with
name
andproject_id
. - Mapping[str, str]
- Tags of the security group to be queried. Conflict with
security_group_id
.
- id String
- name String
- Name of the security group to be queried. Conflict with
security_group_id
. - project
Id Number - Project ID of the security group to be queried. Conflict with
security_group_id
. - result
Output StringFile - Used to save results.
- security
Group StringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - Map<String>
- Tags of the security group to be queried. Conflict with
security_group_id
.
getSecurityGroups Result
The following output properties are available:
- Id string
- Security
Groups List<GetSecurity Groups Security Group> - Information list of security group.
- Name string
- Name of the security group.
- Project
Id double - Project ID of the security group.
- Result
Output stringFile - Security
Group stringId - ID of the security group.
- Dictionary<string, string>
- Tags of the security group.
- Id string
- Security
Groups []GetSecurity Groups Security Group - Information list of security group.
- Name string
- Name of the security group.
- Project
Id float64 - Project ID of the security group.
- Result
Output stringFile - Security
Group stringId - ID of the security group.
- map[string]string
- Tags of the security group.
- id String
- security
Groups List<GetSecurity Groups Security Group> - Information list of security group.
- name String
- Name of the security group.
- project
Id Double - Project ID of the security group.
- result
Output StringFile - security
Group StringId - ID of the security group.
- Map<String,String>
- Tags of the security group.
- id string
- security
Groups GetSecurity Groups Security Group[] - Information list of security group.
- name string
- Name of the security group.
- project
Id number - Project ID of the security group.
- result
Output stringFile - security
Group stringId - ID of the security group.
- {[key: string]: string}
- Tags of the security group.
- id str
- security_
groups Sequence[GetSecurity Groups Security Group] - Information list of security group.
- name str
- Name of the security group.
- project_
id float - Project ID of the security group.
- result_
output_ strfile - security_
group_ strid - ID of the security group.
- Mapping[str, str]
- Tags of the security group.
- id String
- security
Groups List<Property Map> - Information list of security group.
- name String
- Name of the security group.
- project
Id Number - Project ID of the security group.
- result
Output StringFile - security
Group StringId - ID of the security group.
- Map<String>
- Tags of the security group.
Supporting Types
GetSecurityGroupsSecurityGroup
- Be
Associate doubleCount - Number of security group binding resources.
- Create
Time string - Creation time of security group.
- Description string
- Description of the security group.
- Egresses List<string>
- Egress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - Ingresses List<string>
- Ingress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - Name string
- Name of the security group to be queried. Conflict with
security_group_id
. - Project
Id double - Project ID of the security group to be queried. Conflict with
security_group_id
. - Security
Group stringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - Dictionary<string, string>
- Tags of the security group to be queried. Conflict with
security_group_id
.
- Be
Associate float64Count - Number of security group binding resources.
- Create
Time string - Creation time of security group.
- Description string
- Description of the security group.
- Egresses []string
- Egress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - Ingresses []string
- Ingress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - Name string
- Name of the security group to be queried. Conflict with
security_group_id
. - Project
Id float64 - Project ID of the security group to be queried. Conflict with
security_group_id
. - Security
Group stringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - map[string]string
- Tags of the security group to be queried. Conflict with
security_group_id
.
- be
Associate DoubleCount - Number of security group binding resources.
- create
Time String - Creation time of security group.
- description String
- Description of the security group.
- egresses List<String>
- Egress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - ingresses List<String>
- Ingress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - name String
- Name of the security group to be queried. Conflict with
security_group_id
. - project
Id Double - Project ID of the security group to be queried. Conflict with
security_group_id
. - security
Group StringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - Map<String,String>
- Tags of the security group to be queried. Conflict with
security_group_id
.
- be
Associate numberCount - Number of security group binding resources.
- create
Time string - Creation time of security group.
- description string
- Description of the security group.
- egresses string[]
- Egress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - ingresses string[]
- Ingress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - name string
- Name of the security group to be queried. Conflict with
security_group_id
. - project
Id number - Project ID of the security group to be queried. Conflict with
security_group_id
. - security
Group stringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - {[key: string]: string}
- Tags of the security group to be queried. Conflict with
security_group_id
.
- be_
associate_ floatcount - Number of security group binding resources.
- create_
time str - Creation time of security group.
- description str
- Description of the security group.
- egresses Sequence[str]
- Egress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - ingresses Sequence[str]
- Ingress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - name str
- Name of the security group to be queried. Conflict with
security_group_id
. - project_
id float - Project ID of the security group to be queried. Conflict with
security_group_id
. - security_
group_ strid - ID of the security group to be queried. Conflict with
name
andproject_id
. - Mapping[str, str]
- Tags of the security group to be queried. Conflict with
security_group_id
.
- be
Associate NumberCount - Number of security group binding resources.
- create
Time String - Creation time of security group.
- description String
- Description of the security group.
- egresses List<String>
- Egress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - ingresses List<String>
- Ingress rules set. For items like
[action]#[cidr_ip]#[port]#[protocol]
, it means a regular rule; for items likesg-XXXX
, it means a nested security group. - name String
- Name of the security group to be queried. Conflict with
security_group_id
. - project
Id Number - Project ID of the security group to be queried. Conflict with
security_group_id
. - security
Group StringId - ID of the security group to be queried. Conflict with
name
andproject_id
. - Map<String>
- Tags of the security group to be queried. Conflict with
security_group_id
.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack