Issue
I have recently been working on programatically adding and removing ingress rules to security groups on my EC2 server. However, I now seem to have hit a bit of a wall.
I would like to be able to modify existing rules through a python script, but I haven't been able to find any guidance on the Boto3 docs.
Is there any way in which this can be done?
Thanks
Solution
There is no API to modify a rule in SG. You have to revoke the rule first and then add the rule with the modified parameters using authorize. The link also has code snippets.
- authorize_egress()
- authorize_ingress()
- revoke_egress()
- revoke_ingress()
Answered By - helloV