Last active
December 24, 2019 07:15
-
-
Save arc279/cee9f0248715f9d28c02a98f394c74e4 to your computer and use it in GitHub Desktop.
awscli で elasticache の arn が引けないので手で作るやつ
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
### | |
# make elasticache arn | |
### | |
export AWS_REGION := ap-northeast-1 | |
# ex) arn:aws:elasticache:us-west-2:1234567890:cluster:my-cluster | |
.PHONY: arn | |
arn: fetch | |
@ cat c.json \ | |
| jq '.CacheClusters[].CacheClusterId' \ | |
| jq --slurpfile i i.json \ | |
-r '"arn:aws:elasticache:\(env.AWS_REGION):\($$i[0].Account):cluster:\(.)"' | |
.PHONY: fetch | |
fetch: c.json i.json | |
c.json: | |
@ aws elasticache describe-cache-clusters | tee $@ | |
i.json: | |
@ aws sts get-caller-identity | tee $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment