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_name="$1" | |
echo "Removing user: ${user_name}" | |
echo "Deleting Access Keys:" | |
keys=("$(aws iam list-access-keys --user-name "${user_name}" | jq -r '.AccessKeyMetadata[] | .AccessKeyId')") | |
if [[ "${#keys}" -gt "0" ]]; then | |
# shellcheck disable=SC2068 |
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/sh | |
# Use AWS CLI to get the most recent version of an AMI that | |
# matches certain criteria. Has obvious uses. Made possible via | |
# --query, --output text, and the fact that RFC3339 datetime | |
# fields are easily sortable. | |
export AWS_DEFAULT_REGION=us-east-1 | |
aws ec2 describe-images \ |
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
aws support describe-trusted-advisor-check-result --check-id eW7HH0l7J9 --query 'result.sort_by(flaggedResources[?status!="ok"],&metadata[2])[].metadata' --output table --region us-east-1 |