Volcengine v0.0.37 published on Wednesday, Oct 22, 2025 by Volcengine
volcengine.vpc.getSecurityGroupRules
Use this data source to query detailed information of security group rules
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
const default = volcengine.vpc.getSecurityGroupRules({
    securityGroupId: "sg-13f2nau7x93wg3n6nu3z5sxib",
});
import pulumi
import pulumi_volcengine as volcengine
default = volcengine.vpc.get_security_group_rules(security_group_id="sg-13f2nau7x93wg3n6nu3z5sxib")
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vpc.GetSecurityGroupRules(ctx, &vpc.GetSecurityGroupRulesArgs{
			SecurityGroupId: "sg-13f2nau7x93wg3n6nu3z5sxib",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() => 
{
    var @default = Volcengine.Vpc.GetSecurityGroupRules.Invoke(new()
    {
        SecurityGroupId = "sg-13f2nau7x93wg3n6nu3z5sxib",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.vpc.VpcFunctions;
import com.pulumi.volcengine.vpc.inputs.GetSecurityGroupRulesArgs;
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 default = VpcFunctions.getSecurityGroupRules(GetSecurityGroupRulesArgs.builder()
            .securityGroupId("sg-13f2nau7x93wg3n6nu3z5sxib")
            .build());
    }
}
variables:
  default:
    fn::invoke:
      Function: volcengine:vpc:getSecurityGroupRules
      Arguments:
        securityGroupId: sg-13f2nau7x93wg3n6nu3z5sxib
Using getSecurityGroupRules
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 getSecurityGroupRules(args: GetSecurityGroupRulesArgs, opts?: InvokeOptions): Promise<GetSecurityGroupRulesResult>
function getSecurityGroupRulesOutput(args: GetSecurityGroupRulesOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupRulesResult>def get_security_group_rules(cidr_ip: Optional[str] = None,
                             direction: Optional[str] = None,
                             output_file: Optional[str] = None,
                             protocol: Optional[str] = None,
                             security_group_id: Optional[str] = None,
                             source_group_id: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetSecurityGroupRulesResult
def get_security_group_rules_output(cidr_ip: Optional[pulumi.Input[str]] = None,
                             direction: Optional[pulumi.Input[str]] = None,
                             output_file: Optional[pulumi.Input[str]] = None,
                             protocol: Optional[pulumi.Input[str]] = None,
                             security_group_id: Optional[pulumi.Input[str]] = None,
                             source_group_id: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupRulesResult]func GetSecurityGroupRules(ctx *Context, args *GetSecurityGroupRulesArgs, opts ...InvokeOption) (*GetSecurityGroupRulesResult, error)
func GetSecurityGroupRulesOutput(ctx *Context, args *GetSecurityGroupRulesOutputArgs, opts ...InvokeOption) GetSecurityGroupRulesResultOutput> Note: This function is named GetSecurityGroupRules in the Go SDK.
public static class GetSecurityGroupRules 
{
    public static Task<GetSecurityGroupRulesResult> InvokeAsync(GetSecurityGroupRulesArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityGroupRulesResult> Invoke(GetSecurityGroupRulesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSecurityGroupRulesResult> getSecurityGroupRules(GetSecurityGroupRulesArgs args, InvokeOptions options)
public static Output<GetSecurityGroupRulesResult> getSecurityGroupRules(GetSecurityGroupRulesArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:vpc/getSecurityGroupRules:getSecurityGroupRules
  arguments:
    # arguments dictionaryThe following arguments are supported:
- SecurityGroup stringId 
- SecurityGroup ID.
- CidrIp string
- Cidr ip of egress/ingress Rule.
- Direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- OutputFile string
- File name where to save data source results.
- Protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- SourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- SecurityGroup stringId 
- SecurityGroup ID.
- CidrIp string
- Cidr ip of egress/ingress Rule.
- Direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- OutputFile string
- File name where to save data source results.
- Protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- SourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- securityGroup StringId 
- SecurityGroup ID.
- cidrIp String
- Cidr ip of egress/ingress Rule.
- direction String
- Direction of rule, ingress (inbound) or egress (outbound).
- outputFile String
- File name where to save data source results.
- protocol String
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- sourceGroup StringId 
- ID of the source security group whose access permission you want to set.
- securityGroup stringId 
- SecurityGroup ID.
- cidrIp string
- Cidr ip of egress/ingress Rule.
- direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- outputFile string
- File name where to save data source results.
- protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- sourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- security_group_ strid 
- SecurityGroup ID.
- cidr_ip str
- Cidr ip of egress/ingress Rule.
- direction str
- Direction of rule, ingress (inbound) or egress (outbound).
- output_file str
- File name where to save data source results.
- protocol str
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- source_group_ strid 
- ID of the source security group whose access permission you want to set.
- securityGroup StringId 
- SecurityGroup ID.
- cidrIp String
- Cidr ip of egress/ingress Rule.
- direction String
- Direction of rule, ingress (inbound) or egress (outbound).
- outputFile String
- File name where to save data source results.
- protocol String
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- sourceGroup StringId 
- ID of the source security group whose access permission you want to set.
getSecurityGroupRules Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- SecurityGroup stringId 
- Id of SecurityGroup.
- SecurityGroup List<GetRules Security Group Rules Security Group Rule> 
- The collection of SecurityGroup query.
- CidrIp string
- Cidr ip of egress/ingress Rule.
- Direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- OutputFile string
- Protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- SourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- Id string
- The provider-assigned unique ID for this managed resource.
- SecurityGroup stringId 
- Id of SecurityGroup.
- SecurityGroup []GetRules Security Group Rules Security Group Rule 
- The collection of SecurityGroup query.
- CidrIp string
- Cidr ip of egress/ingress Rule.
- Direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- OutputFile string
- Protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- SourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- id String
- The provider-assigned unique ID for this managed resource.
- securityGroup StringId 
- Id of SecurityGroup.
- securityGroup List<GetRules Security Group Rules Security Group Rule> 
- The collection of SecurityGroup query.
- cidrIp String
- Cidr ip of egress/ingress Rule.
- direction String
- Direction of rule, ingress (inbound) or egress (outbound).
- outputFile String
- protocol String
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- sourceGroup StringId 
- ID of the source security group whose access permission you want to set.
- id string
- The provider-assigned unique ID for this managed resource.
- securityGroup stringId 
- Id of SecurityGroup.
- securityGroup GetRules Security Group Rules Security Group Rule[] 
- The collection of SecurityGroup query.
- cidrIp string
- Cidr ip of egress/ingress Rule.
- direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- outputFile string
- protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- sourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- id str
- The provider-assigned unique ID for this managed resource.
- security_group_ strid 
- Id of SecurityGroup.
- security_group_ Sequence[Getrules Security Group Rules Security Group Rule] 
- The collection of SecurityGroup query.
- cidr_ip str
- Cidr ip of egress/ingress Rule.
- direction str
- Direction of rule, ingress (inbound) or egress (outbound).
- output_file str
- protocol str
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- source_group_ strid 
- ID of the source security group whose access permission you want to set.
- id String
- The provider-assigned unique ID for this managed resource.
- securityGroup StringId 
- Id of SecurityGroup.
- securityGroup List<Property Map>Rules 
- The collection of SecurityGroup query.
- cidrIp String
- Cidr ip of egress/ingress Rule.
- direction String
- Direction of rule, ingress (inbound) or egress (outbound).
- outputFile String
- protocol String
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- sourceGroup StringId 
- ID of the source security group whose access permission you want to set.
Supporting Types
GetSecurityGroupRulesSecurityGroupRule      
- CidrIp string
- Cidr ip of egress/ingress Rule.
- CreationTime string
- The creation time of security group rule.
- Description string
- description of a group rule.
- Direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- Policy string
- Access strategy.
- PortEnd int
- Port end of egress/ingress Rule.
- PortStart int
- Port start of egress/ingress Rule.
- Priority int
- Priority of a security group rule.
- Protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- SecurityGroup stringId 
- SecurityGroup ID.
- SourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- UpdateTime string
- The update time of security group rule.
- CidrIp string
- Cidr ip of egress/ingress Rule.
- CreationTime string
- The creation time of security group rule.
- Description string
- description of a group rule.
- Direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- Policy string
- Access strategy.
- PortEnd int
- Port end of egress/ingress Rule.
- PortStart int
- Port start of egress/ingress Rule.
- Priority int
- Priority of a security group rule.
- Protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- SecurityGroup stringId 
- SecurityGroup ID.
- SourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- UpdateTime string
- The update time of security group rule.
- cidrIp String
- Cidr ip of egress/ingress Rule.
- creationTime String
- The creation time of security group rule.
- description String
- description of a group rule.
- direction String
- Direction of rule, ingress (inbound) or egress (outbound).
- policy String
- Access strategy.
- portEnd Integer
- Port end of egress/ingress Rule.
- portStart Integer
- Port start of egress/ingress Rule.
- priority Integer
- Priority of a security group rule.
- protocol String
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- securityGroup StringId 
- SecurityGroup ID.
- sourceGroup StringId 
- ID of the source security group whose access permission you want to set.
- updateTime String
- The update time of security group rule.
- cidrIp string
- Cidr ip of egress/ingress Rule.
- creationTime string
- The creation time of security group rule.
- description string
- description of a group rule.
- direction string
- Direction of rule, ingress (inbound) or egress (outbound).
- policy string
- Access strategy.
- portEnd number
- Port end of egress/ingress Rule.
- portStart number
- Port start of egress/ingress Rule.
- priority number
- Priority of a security group rule.
- protocol string
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- securityGroup stringId 
- SecurityGroup ID.
- sourceGroup stringId 
- ID of the source security group whose access permission you want to set.
- updateTime string
- The update time of security group rule.
- cidr_ip str
- Cidr ip of egress/ingress Rule.
- creation_time str
- The creation time of security group rule.
- description str
- description of a group rule.
- direction str
- Direction of rule, ingress (inbound) or egress (outbound).
- policy str
- Access strategy.
- port_end int
- Port end of egress/ingress Rule.
- port_start int
- Port start of egress/ingress Rule.
- priority int
- Priority of a security group rule.
- protocol str
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- security_group_ strid 
- SecurityGroup ID.
- source_group_ strid 
- ID of the source security group whose access permission you want to set.
- update_time str
- The update time of security group rule.
- cidrIp String
- Cidr ip of egress/ingress Rule.
- creationTime String
- The creation time of security group rule.
- description String
- description of a group rule.
- direction String
- Direction of rule, ingress (inbound) or egress (outbound).
- policy String
- Access strategy.
- portEnd Number
- Port end of egress/ingress Rule.
- portStart Number
- Port start of egress/ingress Rule.
- priority Number
- Priority of a security group rule.
- protocol String
- Protocol of the SecurityGroup, the value can be tcporudporicmporall.
- securityGroup StringId 
- SecurityGroup ID.
- sourceGroup StringId 
- ID of the source security group whose access permission you want to set.
- updateTime String
- The update time of security group rule.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the volcengineTerraform Provider.
