snippetbashTip
aws ce — Run cost management operations through the AWS Cost Explorer service. More information: <https://doc
Viewed 0 times
managementoperationscommandrunaws ceclicostthrough
Problem
How to use the
aws ce command: Run cost management operations through the AWS Cost Explorer service. More information: <https://docs.aws.amazon.com/cli/latest/reference/ce/>.Solution
aws ce — Run cost management operations through the AWS Cost Explorer service. More information: <https://docs.aws.amazon.com/cli/latest/reference/ce/>.Create anomaly monitor:
aws ce create-anomaly-monitor --monitor {{monitor_name}} --monitor-type {{monitor_type}}Create anomaly subscription:
aws ce create-anomaly-subscription --subscription {{subscription_name}} --monitor-arn {{monitor_arn}} --subscribers {{subscribers}}Get anomalies:
aws ce get-anomalies --monitor-arn {{monitor_arn}} --start-time {{start_time}} --end-time {{end_time}}Get cost and usage:
aws ce get-cost-and-usage --time-period {{start_date}}/{{end_date}} --granularity {{granularity}} --metrics {{metrics}}Get cost forecast:
aws ce get-cost-forecast --time-period {{start_date}}/{{end_date}} --granularity {{granularity}} --metric {{metric}}Get reservation utilization:
aws ce get-reservation-utilization --time-period {{start_date}}/{{end_date}} --granularity {{granularity}}List cost category definitions:
aws ce list-cost-category-definitionsTag resource:
aws ce tag-resource --resource-arn {{resource_arn}} --tags {{tags}}Code Snippets
Create anomaly monitor
aws ce create-anomaly-monitor --monitor {{monitor_name}} --monitor-type {{monitor_type}}Create anomaly subscription
aws ce create-anomaly-subscription --subscription {{subscription_name}} --monitor-arn {{monitor_arn}} --subscribers {{subscribers}}Get anomalies
aws ce get-anomalies --monitor-arn {{monitor_arn}} --start-time {{start_time}} --end-time {{end_time}}Get cost and usage
aws ce get-cost-and-usage --time-period {{start_date}}/{{end_date}} --granularity {{granularity}} --metrics {{metrics}}Get cost forecast
aws ce get-cost-forecast --time-period {{start_date}}/{{end_date}} --granularity {{granularity}} --metric {{metric}}Context
tldr-pages: common/aws ce
Revisions (0)
No revisions yet.