EC2.Client.
modify_security_group_rules
(**kwargs)¶Modifies the rules of a security group.
See also: AWS API Documentation
Request Syntax
response = client.modify_security_group_rules(
GroupId='string',
SecurityGroupRules=[
{
'SecurityGroupRuleId': 'string',
'SecurityGroupRule': {
'IpProtocol': 'string',
'FromPort': 123,
'ToPort': 123,
'CidrIpv4': 'string',
'CidrIpv6': 'string',
'PrefixListId': 'string',
'ReferencedGroupId': 'string',
'Description': 'string'
}
},
],
DryRun=True|False
)
[REQUIRED]
The ID of the security group.
[REQUIRED]
Information about the security group properties to update.
Describes an update to a security group rule.
The ID of the security group rule.
Information about the security group rule.
The IP protocol name ( tcp
, udp
, icmp
, icmpv6
) or number (see Protocol Numbers ).
Use -1
to specify all protocols.
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 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 codes.
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 code. A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all ICMP/ICMPv6 codes.
The IPv4 CIDR range. To specify a single IPv4 address, use the /32 prefix length.
The IPv6 CIDR range. To specify a single IPv6 address, use the /128 prefix length.
The ID of the prefix list.
The ID of the security group that is referenced in the security group rule.
The description of the security group rule.
DryRunOperation
. Otherwise, it is UnauthorizedOperation
.dict
Response Syntax
{
'Return': True|False
}
Response Structure
(dict) --
Return (boolean) --
Returns true
if the request succeeds; otherwise, returns an error.