aws.vpc.SecurityGroupIngressRule
Explore with Pulumi AI
Manages an inbound (ingress) rule for a security group.
When specifying an inbound rule for your security group in a VPC, the configuration must include a source for the traffic.
NOTE: Using
aws.vpc.SecurityGroupEgressRule
andaws.vpc.SecurityGroupIngressRule
resources is the current best practice. Avoid using theaws.ec2.SecurityGroupRule
resource and theingress
andegress
arguments of theaws.ec2.SecurityGroup
resource for configuring in-line rules, as they struggle with managing multiple CIDR blocks, and tags and descriptions due to the historical lack of unique IDs.
!> WARNING: You should not use the aws.vpc.SecurityGroupEgressRule
and aws.vpc.SecurityGroupIngressRule
resources in conjunction with the aws.ec2.SecurityGroup
resource with in-line rules (using the ingress
and egress
arguments of aws.ec2.SecurityGroup
) or the aws.ec2.SecurityGroupRule
resource. Doing so may cause rule conflicts, perpetual differences, and result in rules being overwritten.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.SecurityGroup("example", {
name: "example",
description: "example",
vpcId: main.id,
tags: {
Name: "example",
},
});
const exampleSecurityGroupIngressRule = new aws.vpc.SecurityGroupIngressRule("example", {
securityGroupId: example.id,
cidrIpv4: "10.0.0.0/8",
fromPort: 80,
ipProtocol: "tcp",
toPort: 80,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2.SecurityGroup("example",
name="example",
description="example",
vpc_id=main["id"],
tags={
"Name": "example",
})
example_security_group_ingress_rule = aws.vpc.SecurityGroupIngressRule("example",
security_group_id=example.id,
cidr_ipv4="10.0.0.0/8",
from_port=80,
ip_protocol="tcp",
to_port=80)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"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 {
example, err := ec2.NewSecurityGroup(ctx, "example", &ec2.SecurityGroupArgs{
Name: pulumi.String("example"),
Description: pulumi.String("example"),
VpcId: pulumi.Any(main.Id),
Tags: pulumi.StringMap{
"Name": pulumi.String("example"),
},
})
if err != nil {
return err
}
_, err = vpc.NewSecurityGroupIngressRule(ctx, "example", &vpc.SecurityGroupIngressRuleArgs{
SecurityGroupId: example.ID(),
CidrIpv4: pulumi.String("10.0.0.0/8"),
FromPort: pulumi.Int(80),
IpProtocol: pulumi.String("tcp"),
ToPort: pulumi.Int(80),
})
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 = new Aws.Ec2.SecurityGroup("example", new()
{
Name = "example",
Description = "example",
VpcId = main.Id,
Tags =
{
{ "Name", "example" },
},
});
var exampleSecurityGroupIngressRule = new Aws.Vpc.SecurityGroupIngressRule("example", new()
{
SecurityGroupId = example.Id,
CidrIpv4 = "10.0.0.0/8",
FromPort = 80,
IpProtocol = "tcp",
ToPort = 80,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.SecurityGroup;
import com.pulumi.aws.ec2.SecurityGroupArgs;
import com.pulumi.aws.vpc.SecurityGroupIngressRule;
import com.pulumi.aws.vpc.SecurityGroupIngressRuleArgs;
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) {
var example = new SecurityGroup("example", SecurityGroupArgs.builder()
.name("example")
.description("example")
.vpcId(main.id())
.tags(Map.of("Name", "example"))
.build());
var exampleSecurityGroupIngressRule = new SecurityGroupIngressRule("exampleSecurityGroupIngressRule", SecurityGroupIngressRuleArgs.builder()
.securityGroupId(example.id())
.cidrIpv4("10.0.0.0/8")
.fromPort(80)
.ipProtocol("tcp")
.toPort(80)
.build());
}
}
resources:
example:
type: aws:ec2:SecurityGroup
properties:
name: example
description: example
vpcId: ${main.id}
tags:
Name: example
exampleSecurityGroupIngressRule:
type: aws:vpc:SecurityGroupIngressRule
name: example
properties:
securityGroupId: ${example.id}
cidrIpv4: 10.0.0.0/8
fromPort: 80
ipProtocol: tcp
toPort: 80
Create SecurityGroupIngressRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecurityGroupIngressRule(name: string, args: SecurityGroupIngressRuleArgs, opts?: CustomResourceOptions);
@overload
def SecurityGroupIngressRule(resource_name: str,
args: SecurityGroupIngressRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecurityGroupIngressRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
ip_protocol: Optional[str] = None,
security_group_id: Optional[str] = None,
cidr_ipv4: Optional[str] = None,
cidr_ipv6: Optional[str] = None,
description: Optional[str] = None,
from_port: Optional[int] = None,
prefix_list_id: Optional[str] = None,
referenced_security_group_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
to_port: Optional[int] = None)
func NewSecurityGroupIngressRule(ctx *Context, name string, args SecurityGroupIngressRuleArgs, opts ...ResourceOption) (*SecurityGroupIngressRule, error)
public SecurityGroupIngressRule(string name, SecurityGroupIngressRuleArgs args, CustomResourceOptions? opts = null)
public SecurityGroupIngressRule(String name, SecurityGroupIngressRuleArgs args)
public SecurityGroupIngressRule(String name, SecurityGroupIngressRuleArgs args, CustomResourceOptions options)
type: aws:vpc:SecurityGroupIngressRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SecurityGroupIngressRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args SecurityGroupIngressRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SecurityGroupIngressRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityGroupIngressRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecurityGroupIngressRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var securityGroupIngressRuleResource = new Aws.Vpc.SecurityGroupIngressRule("securityGroupIngressRuleResource", new()
{
IpProtocol = "string",
SecurityGroupId = "string",
CidrIpv4 = "string",
CidrIpv6 = "string",
Description = "string",
FromPort = 0,
PrefixListId = "string",
ReferencedSecurityGroupId = "string",
Tags =
{
{ "string", "string" },
},
ToPort = 0,
});
example, err := vpc.NewSecurityGroupIngressRule(ctx, "securityGroupIngressRuleResource", &vpc.SecurityGroupIngressRuleArgs{
IpProtocol: pulumi.String("string"),
SecurityGroupId: pulumi.String("string"),
CidrIpv4: pulumi.String("string"),
CidrIpv6: pulumi.String("string"),
Description: pulumi.String("string"),
FromPort: pulumi.Int(0),
PrefixListId: pulumi.String("string"),
ReferencedSecurityGroupId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
ToPort: pulumi.Int(0),
})
var securityGroupIngressRuleResource = new SecurityGroupIngressRule("securityGroupIngressRuleResource", SecurityGroupIngressRuleArgs.builder()
.ipProtocol("string")
.securityGroupId("string")
.cidrIpv4("string")
.cidrIpv6("string")
.description("string")
.fromPort(0)
.prefixListId("string")
.referencedSecurityGroupId("string")
.tags(Map.of("string", "string"))
.toPort(0)
.build());
security_group_ingress_rule_resource = aws.vpc.SecurityGroupIngressRule("securityGroupIngressRuleResource",
ip_protocol="string",
security_group_id="string",
cidr_ipv4="string",
cidr_ipv6="string",
description="string",
from_port=0,
prefix_list_id="string",
referenced_security_group_id="string",
tags={
"string": "string",
},
to_port=0)
const securityGroupIngressRuleResource = new aws.vpc.SecurityGroupIngressRule("securityGroupIngressRuleResource", {
ipProtocol: "string",
securityGroupId: "string",
cidrIpv4: "string",
cidrIpv6: "string",
description: "string",
fromPort: 0,
prefixListId: "string",
referencedSecurityGroupId: "string",
tags: {
string: "string",
},
toPort: 0,
});
type: aws:vpc:SecurityGroupIngressRule
properties:
cidrIpv4: string
cidrIpv6: string
description: string
fromPort: 0
ipProtocol: string
prefixListId: string
referencedSecurityGroupId: string
securityGroupId: string
tags:
string: string
toPort: 0
SecurityGroupIngressRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The SecurityGroupIngressRule resource accepts the following input properties:
- Ip
Protocol string - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - Security
Group stringId - The ID of the security group.
- Cidr
Ipv4 string - The source IPv4 CIDR range.
- Cidr
Ipv6 string - The source IPv6 CIDR range.
- Description string
- The security group rule description.
- From
Port int - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- Prefix
List stringId - The ID of the source prefix list.
- Referenced
Security stringGroup Id - The source security group that is referenced in the rule.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - To
Port int - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- Ip
Protocol string - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - Security
Group stringId - The ID of the security group.
- Cidr
Ipv4 string - The source IPv4 CIDR range.
- Cidr
Ipv6 string - The source IPv6 CIDR range.
- Description string
- The security group rule description.
- From
Port int - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- Prefix
List stringId - The ID of the source prefix list.
- Referenced
Security stringGroup Id - The source security group that is referenced in the rule.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - To
Port int - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- ip
Protocol String - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - security
Group StringId - The ID of the security group.
- cidr
Ipv4 String - The source IPv4 CIDR range.
- cidr
Ipv6 String - The source IPv6 CIDR range.
- description String
- The security group rule description.
- from
Port Integer - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- prefix
List StringId - The ID of the source prefix list.
- referenced
Security StringGroup Id - The source security group that is referenced in the rule.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - to
Port Integer - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- ip
Protocol string - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - security
Group stringId - The ID of the security group.
- cidr
Ipv4 string - The source IPv4 CIDR range.
- cidr
Ipv6 string - The source IPv6 CIDR range.
- description string
- The security group rule description.
- from
Port number - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- prefix
List stringId - The ID of the source prefix list.
- referenced
Security stringGroup Id - The source security group that is referenced in the rule.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - to
Port number - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- ip_
protocol str - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - security_
group_ strid - The ID of the security group.
- cidr_
ipv4 str - The source IPv4 CIDR range.
- cidr_
ipv6 str - The source 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.
- prefix_
list_ strid - The ID of the source prefix list.
- referenced_
security_ strgroup_ id - The source security group that is referenced in the rule.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - to_
port int - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- ip
Protocol String - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - security
Group StringId - The ID of the security group.
- cidr
Ipv4 String - The source IPv4 CIDR range.
- cidr
Ipv6 String - The source IPv6 CIDR range.
- description String
- The security group rule description.
- from
Port Number - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- prefix
List StringId - The ID of the source prefix list.
- referenced
Security StringGroup Id - The source security group that is referenced in the rule.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - to
Port Number - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
Outputs
All input properties are implicitly available as output properties. Additionally, the SecurityGroupIngressRule resource produces the following output properties:
- Arn string
- The Amazon Resource Name (ARN) of the security group rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Security
Group stringRule Id - The ID of the security group rule.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- The Amazon Resource Name (ARN) of the security group rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Security
Group stringRule Id - The ID of the security group rule.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The Amazon Resource Name (ARN) of the security group rule.
- id String
- The provider-assigned unique ID for this managed resource.
- security
Group StringRule Id - The ID of the security group rule.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- The Amazon Resource Name (ARN) of the security group rule.
- id string
- The provider-assigned unique ID for this managed resource.
- security
Group stringRule Id - The ID of the security group rule.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- The Amazon Resource Name (ARN) of the security group rule.
- id str
- The provider-assigned unique ID for this managed resource.
- security_
group_ strrule_ id - The ID of the security group rule.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- The Amazon Resource Name (ARN) of the security group rule.
- id String
- The provider-assigned unique ID for this managed resource.
- security
Group StringRule Id - The ID of the security group rule.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing SecurityGroupIngressRule Resource
Get an existing SecurityGroupIngressRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SecurityGroupIngressRuleState, opts?: CustomResourceOptions): SecurityGroupIngressRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
cidr_ipv4: Optional[str] = None,
cidr_ipv6: Optional[str] = None,
description: Optional[str] = None,
from_port: Optional[int] = None,
ip_protocol: Optional[str] = None,
prefix_list_id: Optional[str] = None,
referenced_security_group_id: Optional[str] = None,
security_group_id: Optional[str] = None,
security_group_rule_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
to_port: Optional[int] = None) -> SecurityGroupIngressRule
func GetSecurityGroupIngressRule(ctx *Context, name string, id IDInput, state *SecurityGroupIngressRuleState, opts ...ResourceOption) (*SecurityGroupIngressRule, error)
public static SecurityGroupIngressRule Get(string name, Input<string> id, SecurityGroupIngressRuleState? state, CustomResourceOptions? opts = null)
public static SecurityGroupIngressRule get(String name, Output<String> id, SecurityGroupIngressRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- The Amazon Resource Name (ARN) of the security group rule.
- Cidr
Ipv4 string - The source IPv4 CIDR range.
- Cidr
Ipv6 string - The source IPv6 CIDR range.
- Description string
- The security group rule description.
- From
Port int - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- Ip
Protocol string - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - Prefix
List stringId - The ID of the source prefix list.
- Referenced
Security stringGroup Id - The source security group that is referenced in the rule.
- Security
Group stringId - The ID of the security group.
- Security
Group stringRule Id - The ID of the security group rule.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - To
Port int - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- Arn string
- The Amazon Resource Name (ARN) of the security group rule.
- Cidr
Ipv4 string - The source IPv4 CIDR range.
- Cidr
Ipv6 string - The source IPv6 CIDR range.
- Description string
- The security group rule description.
- From
Port int - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- Ip
Protocol string - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - Prefix
List stringId - The ID of the source prefix list.
- Referenced
Security stringGroup Id - The source security group that is referenced in the rule.
- Security
Group stringId - The ID of the security group.
- Security
Group stringRule Id - The ID of the security group rule.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - To
Port int - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- arn String
- The Amazon Resource Name (ARN) of the security group rule.
- cidr
Ipv4 String - The source IPv4 CIDR range.
- cidr
Ipv6 String - The source IPv6 CIDR range.
- description String
- The security group rule description.
- from
Port Integer - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- ip
Protocol String - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - prefix
List StringId - The ID of the source prefix list.
- referenced
Security StringGroup Id - The source security group that is referenced in the rule.
- security
Group StringId - The ID of the security group.
- security
Group StringRule Id - The ID of the security group rule.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - to
Port Integer - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- arn string
- The Amazon Resource Name (ARN) of the security group rule.
- cidr
Ipv4 string - The source IPv4 CIDR range.
- cidr
Ipv6 string - The source IPv6 CIDR range.
- description string
- The security group rule description.
- from
Port number - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- ip
Protocol string - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - prefix
List stringId - The ID of the source prefix list.
- referenced
Security stringGroup Id - The source security group that is referenced in the rule.
- security
Group stringId - The ID of the security group.
- security
Group stringRule Id - The ID of the security group rule.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - to
Port number - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- arn str
- The Amazon Resource Name (ARN) of the security group rule.
- cidr_
ipv4 str - The source IPv4 CIDR range.
- cidr_
ipv6 str - The source 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.
- ip_
protocol str - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - prefix_
list_ strid - The ID of the source prefix list.
- referenced_
security_ strgroup_ id - The source security group that is referenced in the rule.
- security_
group_ strid - The ID of the security group.
- security_
group_ strrule_ id - The ID of the security group rule.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - to_
port int - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- arn String
- The Amazon Resource Name (ARN) of the security group rule.
- cidr
Ipv4 String - The source IPv4 CIDR range.
- cidr
Ipv6 String - The source IPv6 CIDR range.
- description String
- The security group rule description.
- from
Port Number - The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
- ip
Protocol String - The IP protocol name or number. Use
-1
to specify all protocols. Note that ifip_protocol
is set to-1
, it translates to all protocols, all port ranges, andfrom_port
andto_port
values should not be defined. - prefix
List StringId - The ID of the source prefix list.
- referenced
Security StringGroup Id - The source security group that is referenced in the rule.
- security
Group StringId - The ID of the security group.
- security
Group StringRule Id - The ID of the security group rule.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - to
Port Number - The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
Import
Using pulumi import
, import security group ingress rules using the security_group_rule_id
. For example:
$ pulumi import aws:vpc/securityGroupIngressRule:SecurityGroupIngressRule example sgr-02108b27edd666983
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.