aws ec2 modify-security-group-rules
Modifies the rules of a security group. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To modify a security group rules to update the rule description, the IP protocol, and the CidrIpv4 address range
The following modify-security-group-rules example updates the description, the IP protocol, and the IPV4 CIDR range of a specified security group rule. Use the security-group-rules parameter to enter the updates for the specified security group rules. -1 specifies all protocols.
aws ec2 modify-security-group-rules --group-id sg-1234567890abcdef0 --security-group-rules SecurityGroupRuleId=sgr-abcdef01234567890,SecurityGroupRule='{Description=test,IpProtocol=-1,CidrIpv4=0.0.0.0/0}'Identify--group-idThe ID of the security group.--security-group-rulesInformation about the security group properties to update.Its output
{
"Return": true
}For more information about security group rules, see Security group rules in the Amazon EC2 User Guide.
Options
--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--group-idThe ID of the security group.--security-group-rulesInformation about the security group properties to update.