Skip to content

EC2  >  Operations  >  authorize_security_group_egress

authorize_security_group_egress

Operation

authorize_security_group_egress async

authorize_security_group_egress(request: AuthorizeSecurityGroupEgressInput | AuthorizeSecurityGroupEgressInputDict, /, *, plugins: list[Plugin] | None = None) -> AuthorizeSecurityGroupEgressOutput
authorize_security_group_egress(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[AuthorizeSecurityGroupEgressInputDict]) -> AuthorizeSecurityGroupEgressOutput

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, see Security 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, see Security group rules for different use cases in the Amazon EC2 User Guide.

For information about security group quotas, see Amazon VPC quotas in the Amazon VPC User Guide.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
AuthorizeSecurityGroupEgressOutput

An instance of AuthorizeSecurityGroupEgressOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

AuthorizeSecurityGroupEgressInput dataclass

Bases: _SerdeShape

Dataclass for AuthorizeSecurityGroupEgressInput structure.

Attributes
cidr_ip class-attribute instance-attribute
cidr_ip: str | None = ...

Not supported. Use IP permissions instead.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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 is DryRunOperation. Otherwise, it is UnauthorizedOperation.

from_port class-attribute instance-attribute
from_port: int | None = ...

Not supported. Use IP permissions instead.

group_id class-attribute instance-attribute
group_id: str | None = ...

The ID of the security group.

ip_permissions class-attribute instance-attribute
ip_permissions: list[IpPermission] | None = ...

The permissions for the security group rules.

ip_protocol class-attribute instance-attribute
ip_protocol: str | None = ...

Not supported. Use IP permissions instead.

source_security_group_name class-attribute instance-attribute
source_security_group_name: str | None = ...

Not supported. Use IP permissions instead.

source_security_group_owner_id class-attribute instance-attribute
source_security_group_owner_id: str | None = ...

Not supported. Use IP permissions instead.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags applied to the security group rule.

to_port class-attribute instance-attribute
to_port: int | None = ...

Not supported. Use IP permissions instead.

Dictionaries

AuthorizeSecurityGroupEgressInputDict

Bases: TypedDict

Dictionary form of AuthorizeSecurityGroupEgressInput.

Attributes
cidr_ip instance-attribute
cidr_ip: str | None

Not supported. Use IP permissions instead.

dry_run instance-attribute
dry_run: bool | None

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 is DryRunOperation. Otherwise, it is UnauthorizedOperation.

from_port instance-attribute
from_port: int | None

Not supported. Use IP permissions instead.

group_id instance-attribute
group_id: Required[str]

The ID of the security group.

ip_permissions instance-attribute
ip_permissions: Sequence[IpPermission | IpPermissionDict] | None

The permissions for the security group rules.

ip_protocol instance-attribute
ip_protocol: str | None

Not supported. Use IP permissions instead.

source_security_group_name instance-attribute
source_security_group_name: str | None

Not supported. Use IP permissions instead.

source_security_group_owner_id instance-attribute
source_security_group_owner_id: str | None

Not supported. Use IP permissions instead.

tag_specifications instance-attribute
tag_specifications: Sequence[TagSpecification | TagSpecificationDict] | None

The tags applied to the security group rule.

to_port instance-attribute
to_port: int | None

Not supported. Use IP permissions instead.

Output

AuthorizeSecurityGroupEgressOutput dataclass

Bases: _SerdeShape

Dataclass for AuthorizeSecurityGroupEgressOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

return_ class-attribute instance-attribute
return_: bool | None = ...

Returns true if the request succeeds; otherwise, returns an error.

security_group_rules class-attribute instance-attribute
security_group_rules: list[SecurityGroupRule] | None = ...

Information about the outbound (egress) security group rules that were added.