In this blog I discuss on how to remove an IP from Security Group using Boto3
import boto3
ec2 = boto3.resource('ec2')
s_group = ec2.SecurityGroup('sg-<ID>')
response = s_group.revoke_ingress(IpProtocol="tcp", CidrIp=strIP, FromPort=22, ToPort=22)print (response)Here strIP : IP Range - Example 10.24.25.0/24
From Port and To Port are port Ranges
With the above you can revoke an IP address rule
Hyperion ESS Base training
ReplyDeleteHyperion Fdqm online training
Hyperion Fdqm training
Hyperion Financial Management online training
Hyperion Financial Management training
Hyperion online training
Hyperion training
Hyperion planning online training
Hyperion planning training
AWS online training
ReplyDeleteAzure DevOps online training
Azure online training