This file contains 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
#!/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 \ |
This file contains 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
#!/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 |