Testing aws cloudwatch list-metrics from Docker

docker stop centos7 && docker rm centos7 && docker run --name centos7 -t -i -d centos:7
docker exec -it centos7 bash

yum -y update && yum makecache fast

cd

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
pip install awscli requests


mkdir ~/.aws
echo "" | base64 --decode > ~/.aws/config
chmod 600 ~/.aws/config
echo "" | base64 --decode > ~/.aws/credentials
chmod 600 ~/.aws/credentials

aws cloudwatch list-metrics

aws cloudwatch list-metrics > ~/cw-metrics.json 

cat ~/cw-metrics.json | grep MetricName | sort | uniq
Or configure:
# aws configure
AWS Access Key ID [None]: AKIAJC2RMEVQITUFED3A
AWS Secret Access Key [None]: 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
Default region name [None]: us-west-2
Default output format [None]: json

No comments: