aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Cannot get multiple --dimension to get the estimated cost of a an instance

Open Jesudass opened this issue 10 years ago • 4 comments

Trying to get the estimated cost of a specific instance with below cli command, I am passing multiple dimension arguments. but this seems to be not working. any help would be appreciated.

aws --region us-east-1 cloudwatch get-metric-statistics --metric-name EstimatedCharges --start-time 2016-08-22T23:18:00 --end-time 2016-08-23T23:18:00 --period 60 --namespace AWS/Billing --statistics Maximum --dimension {Name=InstanceId,Value=i-a093415e,Name=Currency,Value=USD} --output text | sort -r -k 3 | head -n 1 | cut -f 2

Jesudass avatar Aug 26 '16 09:08 Jesudass

What exactly is not working? Are you not getting the response you expect back? Debug logs would be helpful here. You can get debug logs by appending --debug to the command you ran.

kyleknap avatar Aug 31 '16 16:08 kyleknap

Closing due to inactivity

JordonPhillips avatar Sep 08 '16 21:09 JordonPhillips

Try:

aws --region us-east-1 cloudwatch get-metric-statistics --metric-name EstimatedCharges --start-time 2016-08-22T23:18:00 --end-time 2016-08-23T23:18:00 --period 60 --namespace AWS/Billing --statistics Maximum --dimension Name=InstanceId,Value=i-a093415e  Name=Currency,Value=USD --output text | sort -r -k 3 | head -n 1 | cut -f 2

anecula avatar Sep 08 '18 19:09 anecula

@anecula Thanks! That was the key help I needed. Nowhere else that I have found does it show the space in between the multiple dimensions.

wsupernor avatar Apr 08 '20 14:04 wsupernor