1. Packages
  2. AWS Classic
  3. API Docs
  4. vpc
  5. getSecurityGroupRule

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.34.0 published on Wednesday, May 8, 2024 by Pulumi

aws.vpc.getSecurityGroupRule

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.34.0 published on Wednesday, May 8, 2024 by Pulumi

    aws.vpc.getSecurityGroupRule provides details about a specific security group rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.vpc.getSecurityGroupRule({
        securityGroupRuleId: securityGroupRuleId,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.vpc.get_security_group_rule(security_group_rule_id=security_group_rule_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpc.GetSecurityGroupRule(ctx, &vpc.GetSecurityGroupRuleArgs{
    			SecurityGroupRuleId: pulumi.StringRef(securityGroupRuleId),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Vpc.GetSecurityGroupRule.Invoke(new()
        {
            SecurityGroupRuleId = securityGroupRuleId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.vpc.VpcFunctions;
    import com.pulumi.aws.vpc.inputs.GetSecurityGroupRuleArgs;
    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 = VpcFunctions.getSecurityGroupRule(GetSecurityGroupRuleArgs.builder()
                .securityGroupRuleId(securityGroupRuleId)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:vpc:getSecurityGroupRule
          Arguments:
            securityGroupRuleId: ${securityGroupRuleId}
    

    Using getSecurityGroupRule

    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 getSecurityGroupRule(args: GetSecurityGroupRuleArgs, opts?: InvokeOptions): Promise<GetSecurityGroupRuleResult>
    function getSecurityGroupRuleOutput(args: GetSecurityGroupRuleOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupRuleResult>
    def get_security_group_rule(filters: Optional[Sequence[GetSecurityGroupRuleFilter]] = None,
                                security_group_rule_id: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetSecurityGroupRuleResult
    def get_security_group_rule_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityGroupRuleFilterArgs]]]] = None,
                                security_group_rule_id: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupRuleResult]
    func GetSecurityGroupRule(ctx *Context, args *GetSecurityGroupRuleArgs, opts ...InvokeOption) (*GetSecurityGroupRuleResult, error)
    func GetSecurityGroupRuleOutput(ctx *Context, args *GetSecurityGroupRuleOutputArgs, opts ...InvokeOption) GetSecurityGroupRuleResultOutput

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

    public static class GetSecurityGroupRule 
    {
        public static Task<GetSecurityGroupRuleResult> InvokeAsync(GetSecurityGroupRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupRuleResult> Invoke(GetSecurityGroupRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecurityGroupRuleResult> getSecurityGroupRule(GetSecurityGroupRuleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:vpc/getSecurityGroupRule:getSecurityGroupRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetSecurityGroupRuleFilter>
    Configuration block(s) for filtering. Detailed below.
    SecurityGroupRuleId string
    ID of the security group rule to select.
    Filters []GetSecurityGroupRuleFilter
    Configuration block(s) for filtering. Detailed below.
    SecurityGroupRuleId string
    ID of the security group rule to select.
    filters List<GetSecurityGroupRuleFilter>
    Configuration block(s) for filtering. Detailed below.
    securityGroupRuleId String
    ID of the security group rule to select.
    filters GetSecurityGroupRuleFilter[]
    Configuration block(s) for filtering. Detailed below.
    securityGroupRuleId string
    ID of the security group rule to select.
    filters Sequence[GetSecurityGroupRuleFilter]
    Configuration block(s) for filtering. Detailed below.
    security_group_rule_id str
    ID of the security group rule to select.
    filters List<Property Map>
    Configuration block(s) for filtering. Detailed below.
    securityGroupRuleId String
    ID of the security group rule to select.

    getSecurityGroupRule Result

    The following output properties are available:

    Arn string
    The Amazon Resource Name (ARN) of the security group rule.
    CidrIpv4 string
    The destination IPv4 CIDR range.
    CidrIpv6 string
    The destination IPv6 CIDR range.
    Description string
    The security group rule description.
    FromPort int
    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    Id string
    IpProtocol string
    The IP protocol name or number. Use -1 to specify all protocols.
    IsEgress bool
    Indicates whether the security group rule is an outbound rule.
    PrefixListId string
    The ID of the destination prefix list.
    ReferencedSecurityGroupId string
    The destination security group that is referenced in the rule.
    SecurityGroupId string
    The ID of the security group.
    SecurityGroupRuleId string
    Tags Dictionary<string, string>
    A map of tags assigned to the resource.
    ToPort int
    (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
    Filters List<GetSecurityGroupRuleFilter>
    Arn string
    The Amazon Resource Name (ARN) of the security group rule.
    CidrIpv4 string
    The destination IPv4 CIDR range.
    CidrIpv6 string
    The destination IPv6 CIDR range.
    Description string
    The security group rule description.
    FromPort int
    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    Id string
    IpProtocol string
    The IP protocol name or number. Use -1 to specify all protocols.
    IsEgress bool
    Indicates whether the security group rule is an outbound rule.
    PrefixListId string
    The ID of the destination prefix list.
    ReferencedSecurityGroupId string
    The destination security group that is referenced in the rule.
    SecurityGroupId string
    The ID of the security group.
    SecurityGroupRuleId string
    Tags map[string]string
    A map of tags assigned to the resource.
    ToPort int
    (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
    Filters []GetSecurityGroupRuleFilter
    arn String
    The Amazon Resource Name (ARN) of the security group rule.
    cidrIpv4 String
    The destination IPv4 CIDR range.
    cidrIpv6 String
    The destination IPv6 CIDR range.
    description String
    The security group rule description.
    fromPort Integer
    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    id String
    ipProtocol String
    The IP protocol name or number. Use -1 to specify all protocols.
    isEgress Boolean
    Indicates whether the security group rule is an outbound rule.
    prefixListId String
    The ID of the destination prefix list.
    referencedSecurityGroupId String
    The destination security group that is referenced in the rule.
    securityGroupId String
    The ID of the security group.
    securityGroupRuleId String
    tags Map<String,String>
    A map of tags assigned to the resource.
    toPort Integer
    (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
    filters List<GetSecurityGroupRuleFilter>
    arn string
    The Amazon Resource Name (ARN) of the security group rule.
    cidrIpv4 string
    The destination IPv4 CIDR range.
    cidrIpv6 string
    The destination IPv6 CIDR range.
    description string
    The security group rule description.
    fromPort number
    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    id string
    ipProtocol string
    The IP protocol name or number. Use -1 to specify all protocols.
    isEgress boolean
    Indicates whether the security group rule is an outbound rule.
    prefixListId string
    The ID of the destination prefix list.
    referencedSecurityGroupId string
    The destination security group that is referenced in the rule.
    securityGroupId string
    The ID of the security group.
    securityGroupRuleId string
    tags {[key: string]: string}
    A map of tags assigned to the resource.
    toPort number
    (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
    filters GetSecurityGroupRuleFilter[]
    arn str
    The Amazon Resource Name (ARN) of the security group rule.
    cidr_ipv4 str
    The destination IPv4 CIDR range.
    cidr_ipv6 str
    The destination IPv6 CIDR range.
    description str
    The security group rule description.
    from_port int
    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    id str
    ip_protocol str
    The IP protocol name or number. Use -1 to specify all protocols.
    is_egress bool
    Indicates whether the security group rule is an outbound rule.
    prefix_list_id str
    The ID of the destination prefix list.
    referenced_security_group_id str
    The destination security group that is referenced in the rule.
    security_group_id str
    The ID of the security group.
    security_group_rule_id str
    tags Mapping[str, str]
    A map of tags assigned to the resource.
    to_port int
    (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
    filters Sequence[GetSecurityGroupRuleFilter]
    arn String
    The Amazon Resource Name (ARN) of the security group rule.
    cidrIpv4 String
    The destination IPv4 CIDR range.
    cidrIpv6 String
    The destination IPv6 CIDR range.
    description String
    The security group rule description.
    fromPort Number
    The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
    id String
    ipProtocol String
    The IP protocol name or number. Use -1 to specify all protocols.
    isEgress Boolean
    Indicates whether the security group rule is an outbound rule.
    prefixListId String
    The ID of the destination prefix list.
    referencedSecurityGroupId String
    The destination security group that is referenced in the rule.
    securityGroupId String
    The ID of the security group.
    securityGroupRuleId String
    tags Map<String>
    A map of tags assigned to the resource.
    toPort Number
    (Optional) The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
    filters List<Property Map>

    Supporting Types

    GetSecurityGroupRuleFilter

    Name string
    Name of the filter field. Valid values can be found in the EC2 DescribeSecurityGroupRules API Reference.
    Values List<string>
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    Name string
    Name of the filter field. Valid values can be found in the EC2 DescribeSecurityGroupRules API Reference.
    Values []string
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name String
    Name of the filter field. Valid values can be found in the EC2 DescribeSecurityGroupRules API Reference.
    values List<String>
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name string
    Name of the filter field. Valid values can be found in the EC2 DescribeSecurityGroupRules API Reference.
    values string[]
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name str
    Name of the filter field. Valid values can be found in the EC2 DescribeSecurityGroupRules API Reference.
    values Sequence[str]
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
    name String
    Name of the filter field. Valid values can be found in the EC2 DescribeSecurityGroupRules API Reference.
    values List<String>
    Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.34.0 published on Wednesday, May 8, 2024 by Pulumi