Skip to content

Instantly share code, notes, and snippets.

@pjaudiomv
pjaudiomv / secgroupdelete_ec2classic.py
Created July 10, 2020 03:12 — forked from arpcefxl/secgroupdelete_ec2classic.py
AWS ec2 security group delete scripts. One script is for ec2-classic, the other is for VPC
#!/usr/bin/env python
# Authored by Chad Smith on 3/10/2015
# please feel free to contact me at arpcefxl@gmail.com with comments or questions
# assumes you have already run aws configure or are running in an ec2 role
import boto.ec2, sys
region = sys.argv[1]
secgroup = sys.argv[2]
conn = boto.ec2.connect_to_region(region)
allgroups = conn.get_all_security_groups()