report_definitions
Creates, updates, deletes or gets a report_definition
resource or lists report_definitions
in a region
Overview
Name | report_definitions |
Type | Resource |
Description | The AWS::CUR::ReportDefinition resource creates a Cost & Usage Report with user-defined settings. You can use this resource to define settings like time granularity (hourly, daily, monthly), file format (Parquet, CSV), and S3 bucket for delivery of these reports. |
Id | aws.cur.report_definitions |
Fields
Name | Datatype | Description |
---|---|---|
report_name | string | The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces. |
time_unit | string | The granularity of the line items in the report. |
format | string | The format that AWS saves the report in. |
compression | string | The compression format that AWS uses for the report. |
additional_schema_elements | array | A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs. |
s3_bucket | string | The S3 bucket where AWS delivers the report. |
s3_prefix | string | The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces. |
s3_region | string | The region of the S3 bucket that AWS delivers the report into. |
additional_artifacts | array | A list of manifests that you want Amazon Web Services to create for this report. |
refresh_closed_reports | boolean | Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to previous months. These charges can include refunds, credits, or support fees. |
report_versioning | string | Whether you want Amazon Web Services to overwrite the previous version of each report or to deliver the report in addition to the previous versions. |
billing_view_arn | string | The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ReportName, TimeUnit, Format, Compression, S3Bucket, S3Prefix, S3Region, RefreshClosedReports, ReportVersioning, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all report_definitions
in a region.
SELECT
region,
report_name,
time_unit,
format,
compression,
additional_schema_elements,
s3_bucket,
s3_prefix,
s3_region,
additional_artifacts,
refresh_closed_reports,
report_versioning,
billing_view_arn
FROM aws.cur.report_definitions
WHERE region = 'us-east-1';
Gets all properties from an individual report_definition
.
SELECT
region,
report_name,
time_unit,
format,
compression,
additional_schema_elements,
s3_bucket,
s3_prefix,
s3_region,
additional_artifacts,
refresh_closed_reports,
report_versioning,
billing_view_arn
FROM aws.cur.report_definitions
WHERE region = 'us-east-1' AND data__Identifier = '<ReportName>';
INSERT
example
Use the following StackQL query and manifest file to create a new report_definition
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.cur.report_definitions (
ReportName,
TimeUnit,
Format,
Compression,
S3Bucket,
S3Prefix,
S3Region,
RefreshClosedReports,
ReportVersioning,
region
)
SELECT
'{{ ReportName }}',
'{{ TimeUnit }}',
'{{ Format }}',
'{{ Compression }}',
'{{ S3Bucket }}',
'{{ S3Prefix }}',
'{{ S3Region }}',
'{{ RefreshClosedReports }}',
'{{ ReportVersioning }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.cur.report_definitions (
ReportName,
TimeUnit,
Format,
Compression,
AdditionalSchemaElements,
S3Bucket,
S3Prefix,
S3Region,
AdditionalArtifacts,
RefreshClosedReports,
ReportVersioning,
BillingViewArn,
region
)
SELECT
'{{ ReportName }}',
'{{ TimeUnit }}',
'{{ Format }}',
'{{ Compression }}',
'{{ AdditionalSchemaElements }}',
'{{ S3Bucket }}',
'{{ S3Prefix }}',
'{{ S3Region }}',
'{{ AdditionalArtifacts }}',
'{{ RefreshClosedReports }}',
'{{ ReportVersioning }}',
'{{ BillingViewArn }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: report_definition
props:
- name: ReportName
value: '{{ ReportName }}'
- name: TimeUnit
value: '{{ TimeUnit }}'
- name: Format
value: '{{ Format }}'
- name: Compression
value: '{{ Compression }}'
- name: AdditionalSchemaElements
value:
- '{{ AdditionalSchemaElements[0] }}'
- name: S3Bucket
value: '{{ S3Bucket }}'
- name: S3Prefix
value: '{{ S3Prefix }}'
- name: S3Region
value: '{{ S3Region }}'
- name: AdditionalArtifacts
value:
- '{{ AdditionalArtifacts[0] }}'
- name: RefreshClosedReports
value: '{{ RefreshClosedReports }}'
- name: ReportVersioning
value: '{{ ReportVersioning }}'
- name: BillingViewArn
value: '{{ BillingViewArn }}'
DELETE
example
/*+ delete */
DELETE FROM aws.cur.report_definitions
WHERE data__Identifier = '<ReportName>'
AND region = 'us-east-1';
Permissions
To operate on the report_definitions
resource, the following permissions are required:
Create
cur:PutReportDefinition,
cur:DescribeReportDefinitions
Read
cur:DescribeReportDefinitions
Update
cur:DescribeReportDefinitions,
cur:ModifyReportDefinition
Delete
cur:DeleteReportDefinition
List
cur:DescribeReportDefinitions