HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3/dist-packages/awscli/examples/ce/get-cost-and-usage.rst
**To retrieve the S3 usage of an account for the month of September 2017**

The following ``get-cost-and-usage`` example retrieves the S3 usage of an account for the month of September 2017. ::

    aws ce get-cost-and-usage \
        --time-period Start=2017-09-01,End=2017-10-01 \
        --granularity MONTHLY \
        --metrics "BlendedCost" "UnblendedCost" "UsageQuantity" \
        --group-by Type=DIMENSION,Key=SERVICE Type=TAG,Key=Environment \
        --filter file://filters.json

Contents of ``filters.json``::

    {
        "Dimensions": {
            "Key": "SERVICE",
            "Values": [
                "Amazon Simple Storage Service"
            ]
        }
    }

Output::

    {
        "GroupDefinitions": [
            {
                "Type": "DIMENSION",
                "Key": "SERVICE"
            },
            {
                "Type": "TAG",
                "Key": "Environment"
            }
        ],
        "ResultsByTime": [
            {
                "Estimated": false,
                "TimePeriod": {
                    "Start": "2017-09-01",
                    "End": "2017-10-01"
                },
                "Total": {},
                "Groups": [
                    {
                        "Keys": [
                            "Amazon Simple Storage Service",
                            "Environment$"
                        ],
                        "Metrics": {
                            "BlendedCost": {
                                "Amount": "40.3527508453",
                                "Unit": "USD"
                            },
                            "UnblendedCost": {
                                "Amount": "40.3543773134",
                                "Unit": "USD"
                            },
                            "UsageQuantity": {
                                "Amount": "9312771.098461578",
                                "Unit": "N/A"
                            }
                        }
                    },
                    {
                        "Keys": [
                            "Amazon Simple Storage Service",
                            "Environment$Dev"
                        ],
                        "Metrics": {
                            "BlendedCost": {
                                "Amount": "0.2682364644",
                                "Unit": "USD"
                            },
                            "UnblendedCost": {
                                "Amount": "0.2682364644",
                                "Unit": "USD"
                            },
                            "UsageQuantity": {
                                "Amount": "22403.4395271182",
                                "Unit": "N/A"
                            }
                        }
                    }
                ]
            }
        ]
    }