report_plans
Creates, updates, deletes or gets a report_plan resource or lists report_plans in a region
Overview
| Name | report_plans |
| Type | Resource |
| Description | Contains detailed information about a report plan in AWS Backup Audit Manager. |
| Id | awscc.backup.report_plans |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
report_plan_name | string | The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_). |
report_plan_arn | string | An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type. |
report_plan_description | string | An optional description of the report plan with a maximum of 1,024 characters. |
report_plan_tags | array | Metadata that you can assign to help organize the report plans that you create. Each tag is a key-value pair. |
report_delivery_channel | object | A structure that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports. |
report_setting | object | Identifies the report template for the report. Reports are built using a report template. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
report_plan_arn | string | An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource type. |
region | string | AWS region. |
For more information, see AWS::Backup::ReportPlan.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | report_plans | INSERT | ReportDeliveryChannel, ReportSetting, region |
delete_resource | report_plans | DELETE | Identifier, region |
update_resource | report_plans | UPDATE | Identifier, PatchDocument, region |
list_resources | report_plans_list_only | SELECT | region |
get_resource | report_plans | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual report_plan.
SELECT
region,
report_plan_name,
report_plan_arn,
report_plan_description,
report_plan_tags,
report_delivery_channel,
report_setting
FROM awscc.backup.report_plans
WHERE
region = '{{ region }}' AND
Identifier = '{{ report_plan_arn }}';
Lists all report_plans in a region.
SELECT
region,
report_plan_arn
FROM awscc.backup.report_plans_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new report_plan resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.backup.report_plans (
ReportDeliveryChannel,
ReportSetting,
region
)
SELECT
'{{ report_delivery_channel }}',
'{{ report_setting }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.backup.report_plans (
ReportPlanName,
ReportPlanDescription,
ReportPlanTags,
ReportDeliveryChannel,
ReportSetting,
region
)
SELECT
'{{ report_plan_name }}',
'{{ report_plan_description }}',
'{{ report_plan_tags }}',
'{{ report_delivery_channel }}',
'{{ report_setting }}',
'{{ 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_plan
props:
- name: report_plan_name
value: '{{ report_plan_name }}'
- name: report_plan_description
value: '{{ report_plan_description }}'
- name: report_plan_tags
value:
- value: '{{ value }}'
key: '{{ key }}'
- name: report_delivery_channel
value:
formats:
- '{{ formats[0] }}'
s3_bucket_name: '{{ s3_bucket_name }}'
s3_key_prefix: '{{ s3_key_prefix }}'
- name: report_setting
value:
report_template: '{{ report_template }}'
framework_arns:
- '{{ framework_arns[0] }}'
accounts:
- '{{ accounts[0] }}'
organization_units:
- '{{ organization_units[0] }}'
regions:
- '{{ regions[0] }}'
UPDATE example
Use the following StackQL query and manifest file to update a report_plan resource, using stack-deploy.
/*+ update */
UPDATE awscc.backup.report_plans
SET PatchDocument = string('{{ {
"ReportPlanDescription": report_plan_description,
"ReportPlanTags": report_plan_tags,
"ReportDeliveryChannel": report_delivery_channel,
"ReportSetting": report_setting
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ report_plan_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.backup.report_plans
WHERE
Identifier = '{{ report_plan_arn }}' 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_plans resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
backup:CreateReportPlan,
backup:DescribeReportPlan,
backup:ListTags,
backup:TagResource,
iam:CreateServiceLinkedRole
backup:DescribeReportPlan,
backup:ListTags
backup:DescribeReportPlan,
backup:UpdateReportPlan,
backup:ListTags,
backup:UntagResource,
backup:TagResource
backup:DeleteReportPlan,
backup:DescribeReportPlan
backup:ListReportPlans