Adds the specified outbound (egress) rules to a security group.
An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 address ranges, the IP address ranges specified by a prefix list, or the instances that are associated with a source security group. For more information, seeSecurity group rules.
You must specify exactly one of the following destinations: an IPv4 or 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 type and code.
Rule changes are propagated to instances associated with the security group as quickly as possible. However, a small delay might occur.
For examples of rules that you can add to security groups for specific access scenarios, seeSecurity group rules for different use cases in theAmazon EC2 User Guide.
For information about security group quotas, seeAmazon VPC quotas in theAmazon VPC User Guide.
The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, seeCommon Query Parameters.
Not supported. Use IP permissions instead.
Type: String
Required: No
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response isDryRunOperation. Otherwise, it isUnauthorizedOperation.
Type: Boolean
Required: No
Not supported. Use IP permissions instead.
Type: Integer
Required: No
The ID of the security group.
Type: String
Required: Yes
The permissions for the security group rules.
Type: Array ofIpPermission objects
Required: No
Not supported. Use IP permissions instead.
Type: String
Required: No
Not supported. Use IP permissions instead.
Type: String
Required: No
Not supported. Use IP permissions instead.
Type: String
Required: No
The tags applied to the security group rule.
Type: Array ofTagSpecification objects
Required: No
Not supported. Use IP permissions instead.
Type: Integer
Required: No
The following elements are returned by the service.
The ID of the request.
Type: String
Returnstrue if the request succeeds; otherwise, returns an error.
Type: Boolean
Information about the outbound (egress) security group rules that were added.
Type: Array ofSecurityGroupRule objects
For information about the errors that are common to all actions, seeCommon client error codes.
This example request grants your security group with the IDsg-1a2b3c4d access to the192.0.2.0/24 and198.51.100.0/24 IPv4 address ranges on TCP port 80.
https://ec2.amazonaws.com/?Action=AuthorizeSecurityGroupEgress&GroupId=sg-1a2b3c4d&IpPermissions.1.IpProtocol=tcp&IpPermissions.1.FromPort=80&IpPermissions.1.ToPort=80&IpPermissions.1.IpRanges.1.CidrIp=192.0.2.0/24&IpPermissions.1.IpRanges.2.CidrIp=198.51.100.0/24&AUTHPARAMS<AuthorizeSecurityGroupEgressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <return>true</return></AuthorizeSecurityGroupEgressResponse>This example request grants egress access from the security group with the IDsg-1a2b3c4d to the security group with the IDsg-9a8d7f5c on TCP port 1433.
https://ec2.amazonaws.com/?Action=AuthorizeSecurityGroupEgress&GroupId=sg-1a2b3c4d&IpPermissions.1.IpProtocol=tcp&IpPermissions.1.FromPort=1433&IpPermissions.1.ToPort=1433&IpPermissions.1.Groups.1.GroupId=sg-9a8d7f5c&AUTHPARAMSThis example request grants your security group with the IDsg-1a2b3c4d access to the2001:db8:1234:1a00::/64 IPv6 address range on TCP port 22.
https://ec2.amazonaws.com/?Action=AuthorizeSecurityGroupEgress&GroupId=sg-1a2b3c4d&IpPermissions.1.IpProtocol=tcp&IpPermissions.1.FromPort=22&IpPermissions.1.ToPort=22&IpPermissions.1.Ipv6Ranges.1.CidrIpv6=2001:db8:1234:1a00::/64&AUTHPARAMSThis example grants access over port 3389 (RDP) to the192.0.2.0/24 IPv4 address range, and includes a description for the rule to help you identify the rule later.
https://ec2.amazonaws.com/?Action=AuthorizeSecurityGroupEgress&GroupId=sg-112233&IpPermissions.1.IpProtocol=tcp&IpPermissions.1.FromPort=3389&IpPermissions.1.ToPort=3389&IpPermissions.1.IpRanges.1.CidrIp=192.0.2.0/24&IpPermissions.1.IpRanges.1.Description=Access to London officeFor more information about using this API in one of the language-specific AWS SDKs, see the following: