Created
March 8, 2023 12:14
-
-
Save sasasin/1692c853d26cd66aa631c2b454734b10 to your computer and use it in GitHub Desktop.
AWS CloudWatch Synthetics Canary のソースコードのzipをダウンロードして解凍するやつ
This file contains hidden or 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 | |
CANARY_NAME="$1" | |
CANARY_SOURCE_LOCATION_ARN=$( \ | |
aws synthetics get-canary \ | |
--name "${CANARY_NAME}" \ | |
--query 'Canary.Code.SourceLocationArn' \ | |
--output text \ | |
) | |
aws lambda get-layer-version-by-arn \ | |
--arn ${CANARY_SOURCE_LOCATION_ARN} \ | |
--query 'Content.Location' \ | |
| xargs wget -O "${CANARY_NAME}".zip | |
unzip -d "${CANARY_NAME}" "${CANARY_NAME}.zip" |
Canary でアクセスしてるURLは
rg 'http' | sed -e 's/ /\n/g' -e 's/\[//g' -e 's/\]//g' -e 's/\'//g' -e 's/;//g' | grep http | sort -u
と出せる
(ひどいsedだ、突貫にしても、もっとマシにできるはずだ
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
などとして使うとガバッと取れる