A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic. Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance. An inbound rule permits instances to receive traffic from the specified IPv4 or IPv6 CIDR address range, or from the instances associated with the specified security group. You can follow this link to know more.
Files:
del_ingress_rule.py
-
First configure the aws credentials using aws-cli.
aws configure
-
Now, from the current directory run the following command to validate the script.
python3 del_ingress_rule.py