AWS Billing and Cost Management Data Exports

2026/03/26 - AWS Billing and Cost Management Data Exports - 4 updated api methods

Changes  With this release we are providing an option to accounts to have their export delivered to an S3 bucket that is not owned by the account.

CreateExport (updated) Link ¶
Changes (request)
{'Export': {'DestinationConfigurations': {'S3Destination': {'S3BucketOwner': 'string'}}}}

Creates a data export and specifies the data query, the delivery preference, and any optional resource tags.

A DataQuery consists of both a QueryStatement and TableConfigurations.

The QueryStatement is an SQL statement. Data Exports only supports a limited subset of the SQL syntax. For more information on the SQL syntax that is supported, see Data query. To view the available tables and columns, see the Data Exports table dictionary.

The TableConfigurations is a collection of specified TableProperties for the table being queried in the QueryStatement. TableProperties are additional configurations you can provide to change the data and schema of a table. Each table can have different TableProperties. However, tables are not required to have any TableProperties. Each table property has a default value that it assumes if not specified. For more information on table configurations, see Data query. To view the table properties available for each table, see the Data Exports table dictionary or use the ListTables API to get a response of all tables and their available properties.

See also: AWS API Documentation

Request Syntax

client.create_export(
    Export={
        'ExportArn': 'string',
        'Name': 'string',
        'Description': 'string',
        'DataQuery': {
            'QueryStatement': 'string',
            'TableConfigurations': {
                'string': {
                    'string': 'string'
                }
            }
        },
        'DestinationConfigurations': {
            'S3Destination': {
                'S3Bucket': 'string',
                'S3BucketOwner': 'string',
                'S3Prefix': 'string',
                'S3Region': 'string',
                'S3OutputConfigurations': {
                    'OutputType': 'CUSTOM',
                    'Format': 'TEXT_OR_CSV'|'PARQUET',
                    'Compression': 'GZIP'|'PARQUET',
                    'Overwrite': 'CREATE_NEW_REPORT'|'OVERWRITE_REPORT'
                }
            }
        },
        'RefreshCadence': {
            'Frequency': 'SYNCHRONOUS'
        }
    },
    ResourceTags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Export:

dict

param Export:

[REQUIRED]

The details of the export, including data query, name, description, and destination configuration.

  • ExportArn (string) --

    The Amazon Resource Name (ARN) for this export.

  • Name (string) -- [REQUIRED]

    The name of this specific data export.

  • Description (string) --

    The description for this specific data export.

  • DataQuery (dict) -- [REQUIRED]

    The data query for this specific data export.

    • QueryStatement (string) -- [REQUIRED]

      The query statement.

    • TableConfigurations (dict) --

      The table configuration.

      • (string) --

        • (dict) --

          • (string) --

            • (string) --

  • DestinationConfigurations (dict) -- [REQUIRED]

    The destination configuration for this specific data export.

    • S3Destination (dict) -- [REQUIRED]

      An object that describes the destination of the data exports file.

      • S3Bucket (string) -- [REQUIRED]

        The name of the Amazon S3 bucket used as the destination of a data export file.

      • S3BucketOwner (string) --

        The AWS Account ID that owns the S3 bucket used as the destination for the data export.

      • S3Prefix (string) -- [REQUIRED]

        The S3 path prefix you want prepended to the name of your data export.

      • S3Region (string) -- [REQUIRED]

        The S3 bucket Region.

      • S3OutputConfigurations (dict) -- [REQUIRED]

        The output configuration for the data export.

        • OutputType (string) -- [REQUIRED]

          The output type for the data export.

        • Format (string) -- [REQUIRED]

          The file format for the data export.

        • Compression (string) -- [REQUIRED]

          The compression type for the data export.

        • Overwrite (string) -- [REQUIRED]

          The rule to follow when generating a version of the data export file. You have the choice to overwrite the previous version or to be delivered in addition to the previous versions. Overwriting exports can save on Amazon S3 storage costs. Creating new export versions allows you to track the changes in cost and usage data over time.

  • RefreshCadence (dict) -- [REQUIRED]

    The cadence for Amazon Web Services to update the export in your S3 bucket.

    • Frequency (string) -- [REQUIRED]

      The frequency that data exports are updated. The export refreshes each time the source data updates, up to three times daily.

type ResourceTags:

list

param ResourceTags:

An optional list of tags to associate with the specified export. Each tag consists of a key and a value, and each key must be unique for the resource.

  • (dict) --

    The tag structure that contains a tag key and value.

    • Key (string) -- [REQUIRED]

      The key that's associated with the tag.

    • Value (string) -- [REQUIRED]

      The value that's associated with the tag.

rtype:

dict

returns:

Response Syntax

{
    'ExportArn': 'string'
}

Response Structure

  • (dict) --

    • ExportArn (string) --

      The Amazon Resource Name (ARN) for this export.

GetExecution (updated) Link ¶
Changes (response)
{'Export': {'DestinationConfigurations': {'S3Destination': {'S3BucketOwner': 'string'}}}}

Exports data based on the source data update.

See also: AWS API Documentation

Request Syntax

client.get_execution(
    ExportArn='string',
    ExecutionId='string'
)
type ExportArn:

string

param ExportArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Export object that generated this specific execution.

type ExecutionId:

string

param ExecutionId:

[REQUIRED]

The ID for this specific execution.

rtype:

dict

returns:

Response Syntax

{
    'ExecutionId': 'string',
    'Export': {
        'ExportArn': 'string',
        'Name': 'string',
        'Description': 'string',
        'DataQuery': {
            'QueryStatement': 'string',
            'TableConfigurations': {
                'string': {
                    'string': 'string'
                }
            }
        },
        'DestinationConfigurations': {
            'S3Destination': {
                'S3Bucket': 'string',
                'S3BucketOwner': 'string',
                'S3Prefix': 'string',
                'S3Region': 'string',
                'S3OutputConfigurations': {
                    'OutputType': 'CUSTOM',
                    'Format': 'TEXT_OR_CSV'|'PARQUET',
                    'Compression': 'GZIP'|'PARQUET',
                    'Overwrite': 'CREATE_NEW_REPORT'|'OVERWRITE_REPORT'
                }
            }
        },
        'RefreshCadence': {
            'Frequency': 'SYNCHRONOUS'
        }
    },
    'ExecutionStatus': {
        'StatusCode': 'INITIATION_IN_PROCESS'|'QUERY_QUEUED'|'QUERY_IN_PROCESS'|'QUERY_FAILURE'|'DELIVERY_IN_PROCESS'|'DELIVERY_SUCCESS'|'DELIVERY_FAILURE',
        'StatusReason': 'INSUFFICIENT_PERMISSION'|'BILL_OWNER_CHANGED'|'INTERNAL_FAILURE',
        'CreatedAt': datetime(2015, 1, 1),
        'CompletedAt': datetime(2015, 1, 1),
        'LastUpdatedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ExecutionId (string) --

      The ID for this specific execution.

    • Export (dict) --

      The export data for this specific execution. This export data is a snapshot from when the execution was generated. The data could be different from the current export data if the export was updated since the execution was generated.

      • ExportArn (string) --

        The Amazon Resource Name (ARN) for this export.

      • Name (string) --

        The name of this specific data export.

      • Description (string) --

        The description for this specific data export.

      • DataQuery (dict) --

        The data query for this specific data export.

        • QueryStatement (string) --

          The query statement.

        • TableConfigurations (dict) --

          The table configuration.

          • (string) --

            • (dict) --

              • (string) --

                • (string) --

      • DestinationConfigurations (dict) --

        The destination configuration for this specific data export.

        • S3Destination (dict) --

          An object that describes the destination of the data exports file.

          • S3Bucket (string) --

            The name of the Amazon S3 bucket used as the destination of a data export file.

          • S3BucketOwner (string) --

            The AWS Account ID that owns the S3 bucket used as the destination for the data export.

          • S3Prefix (string) --

            The S3 path prefix you want prepended to the name of your data export.

          • S3Region (string) --

            The S3 bucket Region.

          • S3OutputConfigurations (dict) --

            The output configuration for the data export.

            • OutputType (string) --

              The output type for the data export.

            • Format (string) --

              The file format for the data export.

            • Compression (string) --

              The compression type for the data export.

            • Overwrite (string) --

              The rule to follow when generating a version of the data export file. You have the choice to overwrite the previous version or to be delivered in addition to the previous versions. Overwriting exports can save on Amazon S3 storage costs. Creating new export versions allows you to track the changes in cost and usage data over time.

      • RefreshCadence (dict) --

        The cadence for Amazon Web Services to update the export in your S3 bucket.

        • Frequency (string) --

          The frequency that data exports are updated. The export refreshes each time the source data updates, up to three times daily.

    • ExecutionStatus (dict) --

      The status of this specific execution.

      • StatusCode (string) --

        The code for the status of the execution.

      • StatusReason (string) --

        The reason for the failed status.

      • CreatedAt (datetime) --

        The time when the execution was created.

      • CompletedAt (datetime) --

        The time when the execution was completed.

      • LastUpdatedAt (datetime) --

        The time when the execution was last updated.

GetExport (updated) Link ¶
Changes (response)
{'Export': {'DestinationConfigurations': {'S3Destination': {'S3BucketOwner': 'string'}}}}

Views the definition of an existing data export.

See also: AWS API Documentation

Request Syntax

client.get_export(
    ExportArn='string'
)
type ExportArn:

string

param ExportArn:

[REQUIRED]

The Amazon Resource Name (ARN) for this export.

rtype:

dict

returns:

Response Syntax

{
    'Export': {
        'ExportArn': 'string',
        'Name': 'string',
        'Description': 'string',
        'DataQuery': {
            'QueryStatement': 'string',
            'TableConfigurations': {
                'string': {
                    'string': 'string'
                }
            }
        },
        'DestinationConfigurations': {
            'S3Destination': {
                'S3Bucket': 'string',
                'S3BucketOwner': 'string',
                'S3Prefix': 'string',
                'S3Region': 'string',
                'S3OutputConfigurations': {
                    'OutputType': 'CUSTOM',
                    'Format': 'TEXT_OR_CSV'|'PARQUET',
                    'Compression': 'GZIP'|'PARQUET',
                    'Overwrite': 'CREATE_NEW_REPORT'|'OVERWRITE_REPORT'
                }
            }
        },
        'RefreshCadence': {
            'Frequency': 'SYNCHRONOUS'
        }
    },
    'ExportStatus': {
        'StatusCode': 'HEALTHY'|'UNHEALTHY',
        'StatusReason': 'INSUFFICIENT_PERMISSION'|'BILL_OWNER_CHANGED'|'INTERNAL_FAILURE',
        'CreatedAt': datetime(2015, 1, 1),
        'LastUpdatedAt': datetime(2015, 1, 1),
        'LastRefreshedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Export (dict) --

      The data for this specific export.

      • ExportArn (string) --

        The Amazon Resource Name (ARN) for this export.

      • Name (string) --

        The name of this specific data export.

      • Description (string) --

        The description for this specific data export.

      • DataQuery (dict) --

        The data query for this specific data export.

        • QueryStatement (string) --

          The query statement.

        • TableConfigurations (dict) --

          The table configuration.

          • (string) --

            • (dict) --

              • (string) --

                • (string) --

      • DestinationConfigurations (dict) --

        The destination configuration for this specific data export.

        • S3Destination (dict) --

          An object that describes the destination of the data exports file.

          • S3Bucket (string) --

            The name of the Amazon S3 bucket used as the destination of a data export file.

          • S3BucketOwner (string) --

            The AWS Account ID that owns the S3 bucket used as the destination for the data export.

          • S3Prefix (string) --

            The S3 path prefix you want prepended to the name of your data export.

          • S3Region (string) --

            The S3 bucket Region.

          • S3OutputConfigurations (dict) --

            The output configuration for the data export.

            • OutputType (string) --

              The output type for the data export.

            • Format (string) --

              The file format for the data export.

            • Compression (string) --

              The compression type for the data export.

            • Overwrite (string) --

              The rule to follow when generating a version of the data export file. You have the choice to overwrite the previous version or to be delivered in addition to the previous versions. Overwriting exports can save on Amazon S3 storage costs. Creating new export versions allows you to track the changes in cost and usage data over time.

      • RefreshCadence (dict) --

        The cadence for Amazon Web Services to update the export in your S3 bucket.

        • Frequency (string) --

          The frequency that data exports are updated. The export refreshes each time the source data updates, up to three times daily.

    • ExportStatus (dict) --

      The status of this specific export.

      • StatusCode (string) --

        The status code for the request.

      • StatusReason (string) --

        The description for the status code.

      • CreatedAt (datetime) --

        The timestamp of when the export was created.

      • LastUpdatedAt (datetime) --

        The timestamp of when the export was updated.

      • LastRefreshedAt (datetime) --

        The timestamp of when the export was last generated.

UpdateExport (updated) Link ¶
Changes (request)
{'Export': {'DestinationConfigurations': {'S3Destination': {'S3BucketOwner': 'string'}}}}

Updates an existing data export by overwriting all export parameters. All export parameters must be provided in the UpdateExport request.

See also: AWS API Documentation

Request Syntax

client.update_export(
    ExportArn='string',
    Export={
        'ExportArn': 'string',
        'Name': 'string',
        'Description': 'string',
        'DataQuery': {
            'QueryStatement': 'string',
            'TableConfigurations': {
                'string': {
                    'string': 'string'
                }
            }
        },
        'DestinationConfigurations': {
            'S3Destination': {
                'S3Bucket': 'string',
                'S3BucketOwner': 'string',
                'S3Prefix': 'string',
                'S3Region': 'string',
                'S3OutputConfigurations': {
                    'OutputType': 'CUSTOM',
                    'Format': 'TEXT_OR_CSV'|'PARQUET',
                    'Compression': 'GZIP'|'PARQUET',
                    'Overwrite': 'CREATE_NEW_REPORT'|'OVERWRITE_REPORT'
                }
            }
        },
        'RefreshCadence': {
            'Frequency': 'SYNCHRONOUS'
        }
    }
)
type ExportArn:

string

param ExportArn:

[REQUIRED]

The Amazon Resource Name (ARN) for this export.

type Export:

dict

param Export:

[REQUIRED]

The name and query details for the export.

  • ExportArn (string) --

    The Amazon Resource Name (ARN) for this export.

  • Name (string) -- [REQUIRED]

    The name of this specific data export.

  • Description (string) --

    The description for this specific data export.

  • DataQuery (dict) -- [REQUIRED]

    The data query for this specific data export.

    • QueryStatement (string) -- [REQUIRED]

      The query statement.

    • TableConfigurations (dict) --

      The table configuration.

      • (string) --

        • (dict) --

          • (string) --

            • (string) --

  • DestinationConfigurations (dict) -- [REQUIRED]

    The destination configuration for this specific data export.

    • S3Destination (dict) -- [REQUIRED]

      An object that describes the destination of the data exports file.

      • S3Bucket (string) -- [REQUIRED]

        The name of the Amazon S3 bucket used as the destination of a data export file.

      • S3BucketOwner (string) --

        The AWS Account ID that owns the S3 bucket used as the destination for the data export.

      • S3Prefix (string) -- [REQUIRED]

        The S3 path prefix you want prepended to the name of your data export.

      • S3Region (string) -- [REQUIRED]

        The S3 bucket Region.

      • S3OutputConfigurations (dict) -- [REQUIRED]

        The output configuration for the data export.

        • OutputType (string) -- [REQUIRED]

          The output type for the data export.

        • Format (string) -- [REQUIRED]

          The file format for the data export.

        • Compression (string) -- [REQUIRED]

          The compression type for the data export.

        • Overwrite (string) -- [REQUIRED]

          The rule to follow when generating a version of the data export file. You have the choice to overwrite the previous version or to be delivered in addition to the previous versions. Overwriting exports can save on Amazon S3 storage costs. Creating new export versions allows you to track the changes in cost and usage data over time.

  • RefreshCadence (dict) -- [REQUIRED]

    The cadence for Amazon Web Services to update the export in your S3 bucket.

    • Frequency (string) -- [REQUIRED]

      The frequency that data exports are updated. The export refreshes each time the source data updates, up to three times daily.

rtype:

dict

returns:

Response Syntax

{
    'ExportArn': 'string'
}

Response Structure

  • (dict) --

    • ExportArn (string) --

      The Amazon Resource Name (ARN) for this export.