Skip to content

Instantly share code, notes, and snippets.

View crabba's full-sized avatar

Andrew Crabb crabba

  • AWS
  • Baltimore, MD
View GitHub Profile
@crabba
crabba / delete_iam_user.sh
Created September 28, 2022 23:59 — forked from hernandanielg/delete_iam_user.sh
Bash script to delete IAM users using AWS cli tool
#!/bin/bash
user=$1
echo "User: $user"
user_policies=$(aws iam list-user-policies --user-name $user --query 'PolicyNames[*]' --output text)
echo "Deleting user policies: $user_policies"
for policy in $user_policies ;
do
#!/bin/bash
# Specify the desired volume size in GiB as a command line argument. If not specified, default to 50 GiB.
SIZE=${1:-50}
# Get the ID of the environment host Amazon EC2 instance.
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
# Get the ID of the Amazon EBS volume associated with the instance.
VOLUMEID=$(aws ec2 describe-instances \