Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
readonly SCRIPT_DIR=$(dirname "$(readlink -m "$0")");
function main
{
set -o errexit
set -o pipefail
set -o nounset
set -o errtrace
aws_account="aws --profile fabien"
$aws_account ec2 describe-vpcs | tee ${SCRIPT_DIR}/reports/vcps.json
$aws_account ec2 describe-subnets | tee ${SCRIPT_DIR}/reports/subnets.json
$aws_account ec2 describe-security-groups | tee ${SCRIPT_DIR}/reports/security_groups.json
$aws_account ec2 describe-instances | tee ${SCRIPT_DIR}/reports/instances.json
$aws_account ec2 describe-volumes | tee ${SCRIPT_DIR}/reports/volumes.json
$aws_account ec2 describe-key-pairs | tee ${SCRIPT_DIR}/reports/key-pairs.json
$aws_account ec2 describe-network-acls | tee ${SCRIPT_DIR}/reports/network-acls.json
$aws_account s3api list-buckets | tee ${SCRIPT_DIR}/reports/s3_list-buckets.json
$aws_account iam list-users | tee ${SCRIPT_DIR}/reports/iam_users.json
$aws_account iam list-groups | tee ${SCRIPT_DIR}/reports/iam_groups.json
$aws_account iam list-roles | tee ${SCRIPT_DIR}/reports/iam_roles.json
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.