Last active
November 12, 2016 11:44
-
-
Save FabienArcellier/693190ef9093a15d4962cc28a1a74789 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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