We recommend new projects start with resources from the AWS provider.
aws-native.ec2.SecurityGroupEgress
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
Adds the specified outbound (egress) rule to a security group. An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 address range, the IP addresses that are specified by a prefix list, or the instances that are associated with a destination security group. For more information, see Security group rules. You must specify exactly one of the following destinations: an IPv4 address range, an IPv6 address range, a prefix list, or a security group. You must specify a protocol for each rule (for example, TCP). If the protocol is TCP or UDP, you must also specify a port or port range. If the protocol is ICMP or ICMPv6, you must also specify the ICMP/ICMPv6 type and code. To specify all types or all codes, use -1. Rule changes are propagated to instances associated with the security group as quickly as possible. However, a small delay might occur.
Create SecurityGroupEgress Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecurityGroupEgress(name: string, args: SecurityGroupEgressArgs, opts?: CustomResourceOptions);
@overload
def SecurityGroupEgress(resource_name: str,
args: SecurityGroupEgressInitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecurityGroupEgress(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
ip_protocol: Optional[str] = None,
cidr_ip: Optional[str] = None,
cidr_ipv6: Optional[str] = None,
description: Optional[str] = None,
destination_prefix_list_id: Optional[str] = None,
destination_security_group_id: Optional[str] = None,
from_port: Optional[int] = None,
to_port: Optional[int] = None)
func NewSecurityGroupEgress(ctx *Context, name string, args SecurityGroupEgressArgs, opts ...ResourceOption) (*SecurityGroupEgress, error)
public SecurityGroupEgress(string name, SecurityGroupEgressArgs args, CustomResourceOptions? opts = null)
public SecurityGroupEgress(String name, SecurityGroupEgressArgs args)
public SecurityGroupEgress(String name, SecurityGroupEgressArgs args, CustomResourceOptions options)
type: aws-native:ec2:SecurityGroupEgress
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 SecurityGroupEgressArgs
- 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 SecurityGroupEgressInitArgs
- 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 SecurityGroupEgressArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecurityGroupEgressArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecurityGroupEgressArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
SecurityGroupEgress Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The SecurityGroupEgress resource accepts the following input properties:
- Group
Id string - The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
- Ip
Protocol string - The IP protocol name (
tcp
,udp
,icmp
,icmpv6
) or number (see Protocol Numbers). Use-1
to specify all protocols. When authorizing security group rules, specifying-1
or a protocol number other thantcp
,udp
,icmp
, oricmpv6
allows traffic on all ports, regardless of any port range you specify. Fortcp
,udp
, andicmp
, you must specify a port range. Foricmpv6
, the port range is optional; if you omit the port range, traffic for all types and codes is allowed. - Cidr
Ip string - The IPv4 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - Cidr
Ipv6 string - The IPv6 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - Description string
- The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
- Destination
Prefix stringList Id - The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - Destination
Security stringGroup Id - The ID of the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - From
Port int - If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
- To
Port int - If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
- Group
Id string - The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
- Ip
Protocol string - The IP protocol name (
tcp
,udp
,icmp
,icmpv6
) or number (see Protocol Numbers). Use-1
to specify all protocols. When authorizing security group rules, specifying-1
or a protocol number other thantcp
,udp
,icmp
, oricmpv6
allows traffic on all ports, regardless of any port range you specify. Fortcp
,udp
, andicmp
, you must specify a port range. Foricmpv6
, the port range is optional; if you omit the port range, traffic for all types and codes is allowed. - Cidr
Ip string - The IPv4 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - Cidr
Ipv6 string - The IPv6 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - Description string
- The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
- Destination
Prefix stringList Id - The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - Destination
Security stringGroup Id - The ID of the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - From
Port int - If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
- To
Port int - If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
- group
Id String - The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
- ip
Protocol String - The IP protocol name (
tcp
,udp
,icmp
,icmpv6
) or number (see Protocol Numbers). Use-1
to specify all protocols. When authorizing security group rules, specifying-1
or a protocol number other thantcp
,udp
,icmp
, oricmpv6
allows traffic on all ports, regardless of any port range you specify. Fortcp
,udp
, andicmp
, you must specify a port range. Foricmpv6
, the port range is optional; if you omit the port range, traffic for all types and codes is allowed. - cidr
Ip String - The IPv4 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - cidr
Ipv6 String - The IPv6 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - description String
- The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
- destination
Prefix StringList Id - The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - destination
Security StringGroup Id - The ID of the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - from
Port Integer - If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
- to
Port Integer - If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
- group
Id string - The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
- ip
Protocol string - The IP protocol name (
tcp
,udp
,icmp
,icmpv6
) or number (see Protocol Numbers). Use-1
to specify all protocols. When authorizing security group rules, specifying-1
or a protocol number other thantcp
,udp
,icmp
, oricmpv6
allows traffic on all ports, regardless of any port range you specify. Fortcp
,udp
, andicmp
, you must specify a port range. Foricmpv6
, the port range is optional; if you omit the port range, traffic for all types and codes is allowed. - cidr
Ip string - The IPv4 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - cidr
Ipv6 string - The IPv6 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - description string
- The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
- destination
Prefix stringList Id - The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - destination
Security stringGroup Id - The ID of the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - from
Port number - If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
- to
Port number - If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
- group_
id str - The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
- ip_
protocol str - The IP protocol name (
tcp
,udp
,icmp
,icmpv6
) or number (see Protocol Numbers). Use-1
to specify all protocols. When authorizing security group rules, specifying-1
or a protocol number other thantcp
,udp
,icmp
, oricmpv6
allows traffic on all ports, regardless of any port range you specify. Fortcp
,udp
, andicmp
, you must specify a port range. Foricmpv6
, the port range is optional; if you omit the port range, traffic for all types and codes is allowed. - cidr_
ip str - The IPv4 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - cidr_
ipv6 str - The IPv6 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - description str
- The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
- destination_
prefix_ strlist_ id - The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - destination_
security_ strgroup_ id - The ID of the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - from_
port int - If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
- to_
port int - If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
- group
Id String - The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
- ip
Protocol String - The IP protocol name (
tcp
,udp
,icmp
,icmpv6
) or number (see Protocol Numbers). Use-1
to specify all protocols. When authorizing security group rules, specifying-1
or a protocol number other thantcp
,udp
,icmp
, oricmpv6
allows traffic on all ports, regardless of any port range you specify. Fortcp
,udp
, andicmp
, you must specify a port range. Foricmpv6
, the port range is optional; if you omit the port range, traffic for all types and codes is allowed. - cidr
Ip String - The IPv4 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - cidr
Ipv6 String - The IPv6 address range, in CIDR format.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide. - description String
- The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
- destination
Prefix StringList Id - The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - destination
Security StringGroup Id - The ID of the security group.
You must specify exactly one of the following:
CidrIp
,CidrIpv6
,DestinationPrefixListId
, orDestinationSecurityGroupId
. - from
Port Number - If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
- to
Port Number - If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
Outputs
All input properties are implicitly available as output properties. Additionally, the SecurityGroupEgress resource produces the following output properties:
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.