Skip to main content

capacity_manager_data_exports

Creates, updates, deletes, gets or lists a capacity_manager_data_exports resource.

Overview

Namecapacity_manager_data_exports
TypeResource
Idaws.ec2.capacity_manager_data_exports

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
capacity_manager_data_export_idstringThe unique identifier for the data export configuration.
create_timestringThe timestamp when the data export configuration was created.
latest_delivery_s3_location_uristringThe S3 URI of the most recently delivered export file.
latest_delivery_statusstringThe status of the most recent export delivery.
latest_delivery_status_messagestringA message describing the status of the most recent export delivery, including any error details if the delivery failed.
latest_delivery_timestringThe timestamp when the most recent export was delivered to S3.
output_formatstringThe file format of the exported data.
s3_bucket_namestringThe name of the S3 bucket where export files are delivered.
s3_bucket_prefixstringThe S3 key prefix used for organizing export files within the bucket.
schedulestringThe frequency at which data exports are generated.
tagsstringThe tags associated with the data export configuration.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_capacity_manager_data_exportsselectregionCapacityManagerDataExportId, MaxResults, NextToken, DryRun, FilterDescribes one or more Capacity Manager data export configurations. Returns information about export settings, delivery status, and recent export activity.
create_capacity_manager_data_exportinsertS3BucketName, OutputFormat, regionS3BucketPrefix, Schedule, ClientToken, DryRun, TagSpecificationCreates a new data export configuration for EC2 Capacity Manager. This allows you to automatically export capacity usage data to an S3 bucket on a scheduled basis. The exported data includes metrics for On-Demand, Spot, and Capacity Reservations usage across your organization.
delete_capacity_manager_data_exportdeleteCapacityManagerDataExportId, regionDryRunDeletes an existing Capacity Manager data export configuration. This stops future scheduled exports but does not delete previously exported files from S3.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
CapacityManagerDataExportIdstringThe unique identifier of the data export configuration to delete.
OutputFormatstringThe file format for the exported data. Parquet format is recommended for large datasets and better compression.
S3BucketNamestringThe name of the S3 bucket where the capacity data export files will be delivered. The bucket must exist and you must have write permissions to it.
regionstringAWS region (default: us-east-1)
CapacityManagerDataExportIdarrayThe IDs of the data export configurations to describe. If not specified, all export configurations are returned.
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayOne or more filters to narrow the results. Supported filters include export status, creation date, and S3 bucket name.
MaxResultsintegerThe maximum number of results to return in a single call. If not specified, up to 1000 results are returned.
NextTokenstringThe token for the next page of results. Use this value in a subsequent call to retrieve additional results.
S3BucketPrefixstringThe S3 key prefix for the exported data files. This allows you to organize exports in a specific folder structure within your bucket. If not specified, files are placed at the bucket root.
SchedulestringThe frequency at which data exports are generated.
TagSpecificationarrayThe tags to apply to the data export configuration. You can tag the export for organization and cost tracking purposes.

SELECT examples

Describes one or more Capacity Manager data export configurations. Returns information about export settings, delivery status, and recent export activity.

SELECT
capacity_manager_data_export_id,
create_time,
latest_delivery_s3_location_uri,
latest_delivery_status,
latest_delivery_status_message,
latest_delivery_time,
output_format,
s3_bucket_name,
s3_bucket_prefix,
schedule,
tags
FROM aws.ec2.capacity_manager_data_exports
WHERE region = '{{ region }}' -- required
AND CapacityManagerDataExportId = '{{ CapacityManagerDataExportId }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
AND Filter = '{{ Filter }}'
;

INSERT examples

Creates a new data export configuration for EC2 Capacity Manager. This allows you to automatically export capacity usage data to an S3 bucket on a scheduled basis. The exported data includes metrics for On-Demand, Spot, and Capacity Reservations usage across your organization.

INSERT INTO aws.ec2.capacity_manager_data_exports (
S3BucketName,
OutputFormat,
region,
S3BucketPrefix,
Schedule,
ClientToken,
DryRun,
TagSpecification
)
SELECT
'{{ S3BucketName }}',
'{{ OutputFormat }}',
'{{ region }}',
'{{ S3BucketPrefix }}',
'{{ Schedule }}',
'{{ ClientToken }}',
'{{ DryRun }}',
'{{ TagSpecification }}'
RETURNING
capacity_manager_data_export_id
;

DELETE examples

Deletes an existing Capacity Manager data export configuration. This stops future scheduled exports but does not delete previously exported files from S3.

DELETE FROM aws.ec2.capacity_manager_data_exports
WHERE CapacityManagerDataExportId = '{{ CapacityManagerDataExportId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;