Skip to content

Instantly share code, notes, and snippets.

@sansagara
Created July 24, 2019 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sansagara/6cd315356581286714801a25ae95c544 to your computer and use it in GitHub Desktop.
Save sansagara/6cd315356581286714801a25ae95c544 to your computer and use it in GitHub Desktop.
List AWS Kinesis streams along with tags
#!/bin/bash
# lists all Kinesis streams along with their tags in the following format:
# stream_name | { tag_name: tag_value }
# depends on AWS CLI and JQ
for stream in `aws kinesis list-streams | jq .StreamNames[] -r`; do
tags=$(aws kinesis list-tags-for-stream --stream-name ${stream} | jq -c '.[][] | {(.Key): .Value}' | tr '\n' '\t')
echo ${stream} '|' ${tags}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment