Skip to content

Instantly share code, notes, and snippets.

@akloya
Last active June 27, 2019 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akloya/8e19fb58f1f168dfb92d86684cc83a15 to your computer and use it in GitHub Desktop.
Save akloya/8e19fb58f1f168dfb92d86684cc83a15 to your computer and use it in GitHub Desktop.
import boto3
ec2 = boto3.client("ec2")
ec2_resource = boto3.resource('ec2')
for vpc in ec2.describe_vpcs()['Vpcs']:
vpc = ec2_resource.Vpc(vpc['VpcId'])
network_acl_iterator = vpc.network_acls.all()
for i in network_acl_iterator:
response = ec2.describe_network_acls(
NetworkAclIds=[
i.id
]
)
for acls in response['NetworkAcls']:
print(acls)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment