Skip to content

Instantly share code, notes, and snippets.

@sansagara
Last active April 12, 2020 16:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sansagara/3416f4075c685e50f18ad9775224cf8d to your computer and use it in GitHub Desktop.
Adds a tag to all kinesis streams on the default region.
#!/bin/bash
# Adds a tag to all kinesis streams on the default region.
# depends on AWS CLI and JQ
TAG_KEY="Hello"
TAG_VALUE="World"
for amiId in `aws ec2 describe-images --region us-east-1 --owners self --output json --query 'Images' | jq '.[] | .ImageId' -r`; do
instances=$(aws ec2 describe-instances --region us-east-1 --filters "Name=image-id,Values=${amiId}")
echo ${amiId} '|' ${instances}
done
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment