Cannot get multiple --dimension to get the estimated cost of a an instance
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
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.
Closing due to inactivity
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 Thanks! That was the key help I needed. Nowhere else that I have found does it show the space in between the multiple dimensions.