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 | awscc.cur.report_definitions |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| 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. |
region | string | AWS region. |
For more information, see AWS::CUR::ReportDefinition.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | report_definitions | INSERT | ReportName, TimeUnit, Format, Compression, S3Bucket, S3Prefix, S3Region, RefreshClosedReports, ReportVersioning, region |
delete_resource | report_definitions | DELETE | Identifier, region |
update_resource | report_definitions | UPDATE | Identifier, PatchDocument, region |
list_resources | report_definitions_list_only | SELECT | region |
get_resource | report_definitions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.cur.report_definitions
WHERE
region = '{{ region }}' AND
Identifier = '{{ report_name }}';
Lists all report_definitions in a region.
SELECT
region,
report_name
FROM awscc.cur.report_definitions_list_only
WHERE
region = '{{ region }}';
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 awscc.cur.report_definitions (
ReportName,
TimeUnit,
Format,
Compression,
S3Bucket,
S3Prefix,
S3Region,
RefreshClosedReports,
ReportVersioning,
region
)
SELECT
'{{ report_name }}',
'{{ time_unit }}',
'{{ format }}',
'{{ compression }}',
'{{ s3_bucket }}',
'{{ s3_prefix }}',
'{{ s3_region }}',
'{{ refresh_closed_reports }}',
'{{ report_versioning }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.cur.report_definitions (
ReportName,
TimeUnit,
Format,
Compression,
AdditionalSchemaElements,
S3Bucket,
S3Prefix,
S3Region,
AdditionalArtifacts,
RefreshClosedReports,
ReportVersioning,
BillingViewArn,
region
)
SELECT
'{{ 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 }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: report_definition
props:
- name: report_name
value: '{{ report_name }}'
- name: time_unit
value: '{{ time_unit }}'
- name: format
value: '{{ format }}'
- name: compression
value: '{{ compression }}'
- name: additional_schema_elements
value:
- '{{ additional_schema_elements[0] }}'
- name: s3_bucket
value: '{{ s3_bucket }}'
- name: s3_prefix
value: '{{ s3_prefix }}'
- name: s3_region
value: '{{ s3_region }}'
- name: additional_artifacts
value:
- '{{ additional_artifacts[0] }}'
- name: refresh_closed_reports
value: '{{ refresh_closed_reports }}'
- name: report_versioning
value: '{{ report_versioning }}'
- name: billing_view_arn
value: '{{ billing_view_arn }}'
UPDATE example
Use the following StackQL query and manifest file to update a report_definition resource, using stack-deploy.
/*+ update */
UPDATE awscc.cur.report_definitions
SET PatchDocument = string('{{ {
"Format": format,
"Compression": compression,
"S3Bucket": s3_bucket,
"S3Prefix": s3_prefix,
"S3Region": s3_region,
"AdditionalArtifacts": additional_artifacts,
"RefreshClosedReports": refresh_closed_reports
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ report_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.cur.report_definitions
WHERE
Identifier = '{{ report_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the report_definitions resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
cur:PutReportDefinition,
cur:DescribeReportDefinitions
cur:DescribeReportDefinitions
cur:DescribeReportDefinitions,
cur:ModifyReportDefinition
cur:DeleteReportDefinition
cur:DescribeReportDefinitions