Skip to content

Instantly share code, notes, and snippets.

View z0ph's full-sized avatar
🚀
Love People and use things, because the opposite never works

Victor GRENU z0ph

🚀
Love People and use things, because the opposite never works
View GitHub Profile
@z0ph
z0ph / ec2.sh
Created April 28, 2019 07:05 — forked from junaidk/ec2.sh
Get List of EC2 instances from All regions
# install aws cli first
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "\nListing Instances in region:'$region'..."
aws ec2 describe-instances --query "Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[0].Value}" --output=table --region $region
done
@z0ph
z0ph / security-group-cleanup.py
Last active June 28, 2018 09:13 — forked from TomRyan-321/security-group-cleanup.py
Security Group Cleanup using boto3 with RDS check fixed
#!/usr/bin/env python
import boto3
import argparse
def lookup_by_id(sgid):
sg = ec2.get_all_security_groups(group_ids=sgid)
return sg[0].name
# get a full list of the available regions
session = boto3.Session(profile_name='dev')