Created
August 22, 2020 09:24
-
-
Save mattsan/ab4e3dce35a6c0bd37c1fa61a3e2a70f to your computer and use it in GitHub Desktop.
AWS Events の内容を一覧する
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 | |
if [ "$1" = "production" ]; then | |
STAGE=production | |
elif [ "$1" = "staging" ] || [ "$1" = "" ]; then | |
STAGE=staging | |
else | |
cat <<EOS | |
usage: | |
bin/events [stage] | |
stage: 'production' or 'staging' (default: 'staging') | |
EOS | |
exit 1 | |
fi | |
QUERY=Rules[].[State,Name,Description] | |
echo | |
echo ' State | Name | Description' | |
echo '-----------|---------------------------------------------------------|--------------------' | |
aws events list-rules \ | |
--profile "$STAGE" \ | |
--query "$QUERY" \ | |
--output text \ | |
| awk '{ printf(" %-8s | %-55s | %s\n", $1, $2, $3) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment