AWS commands

aws s3 ls --summarize --human-readable --recursive s3://BUCKETNAME/PATH
or
aws s3 ls s3://BUCKETNAME/PATH --recursive | awk '{total+=$3} END{print "total =",total/1024/1024," MB"}'
aws cloudwatch get-metric-statistics --namespace AWS/S3 \
  --start-time 2018-02-05T00:00:00 --end-time 2018-02-06T00:00:00 \
  --period 86400 --statistics Average --region eu-west-1 --metric-name BucketSizeBytes \
  --dimensions Name=BucketName,Value=BUCKETNAME Name=StorageType,Value=StandardStorage \
  | jq -r '.Datapoints[0].Average' \
  | awk '{total+=$0} END{print "total =",int(total/1024/1024)," MB"}'
curl http://169.254.169.254/latest/user-data
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId]' --region eu-west-3 --output text | wc -l
  • aws.txt
  • Last modified: 2019/06/02 18:32
  • by jdx