I hereby claim:
- I am hatchcanon on github.
- I am ncho (https://keybase.io/ncho) on keybase.
- I have a public key ASABvm2bJ2mYKlq_n007LHjAt0ZbrhSzskDyZk3BBTcqxAo
To claim this, I am signing this object:
for bucket_name in $(aws s3api list-buckets --query "Buckets[].Name" --output text); do | |
echo -ne "${bucket_name}," | |
encryption_info=$(aws s3api get-bucket-encryption \ | |
--bucket ${bucket_name} 2>/dev/null) | |
if [[ $? != 0 ]]; then | |
echo "no-encryption" | |
else | |
echo "${encryption_info}" | |
fi | |
done |
#!/bin/bash | |
for instance in $(aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId]' --output text ) | |
do | |
managed=$(aws ssm describe-instance-information --filters "Key=InstanceIds,Values=$instance" --query 'InstanceInformationList[*].[AssociationStatus]' --output text) | |
if [[ "$managed" != "Success" ]]; then | |
managed=" Not Managed"; | |
fi | |
aws ec2 describe-instances --instance-id $instance --output text --query 'Reservations[*].Instances[*].[InstanceId, Placement.AvailabilityZone, [Tags[?Key==`Name`].Value] [0][0], [Tags[?Key==`App`].Value] [0][0], [Tags[?Key==`Product`].Value] [0][0], [Tags[?Key==`Team`].Value] [0][0] ]' | |
echo " $managed" | |
done |
#!/bin/bash | |
for instance in $(aws ec2 describe-instances --region us-east-1 | grep InstanceId | cut -d '"' -f 4 | sort); do | |
echo -n $instance | |
aws ec2 describe-instance-attribute --instance-id $instance --attribute disableApiTermination | grep Value | cut -d : -f 2 | |
done |
file="filewithsnapshotids.txt" | |
cat $file | tr -d '\r' | while read -r line; | |
do | |
aws ec2 delete-snapshot --snapshot-id $line | |
echo "Deleting snapshot $line" | |
done |
#!/bin/bash | |
VAULT_NAME="" | |
echo "Enter the name of the vault where all backups should be deleted" | |
read -t 10 VAULT_NAME || exit | |
# be sure to change the by-created-before and by-created-after to your liking | |
for ARN in $(aws backup list-recovery-points-by-backup-vault --backup-vault-name "${VAULT_NAME}" --by-created-before "2021-01-28T21:28:00/-0600" --by-created-after "2021-01-28T21:26:00/-0600" --query 'RecoveryPoints[].RecoveryPointArn' --output text --region us-east-1); do | |
echo "deleting ${ARN} ..." | |
aws backup delete-recovery-point --region us-east-1 --backup-vault-name "${VAULT_NAME}" --recovery-point-arn "${ARN}" |
I hereby claim:
To claim this, I am signing this object: