backup_plans
Creates, updates, deletes or gets a backup_plan resource or lists backup_plans in a region
Overview
| Name | backup_plans |
| Type | Resource |
| Description | Resource Type definition for AWS::Backup::BackupPlan |
| Id | awscc.backup.backup_plans |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
backup_plan | object | |
backup_plan_tags | object | |
backup_plan_arn | string | |
backup_plan_id | string | |
version_id | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
backup_plan | object | |
backup_plan_id | string | |
region | string | AWS region. |
For more information, see AWS::Backup::BackupPlan.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | backup_plans | INSERT | BackupPlan, region |
delete_resource | backup_plans | DELETE | Identifier, region |
update_resource | backup_plans | UPDATE | Identifier, PatchDocument, region |
list_resources | backup_plans_list_only | SELECT | region |
get_resource | backup_plans | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual backup_plan.
SELECT
region,
backup_plan,
backup_plan_tags,
backup_plan_arn,
backup_plan_id,
version_id
FROM awscc.backup.backup_plans
WHERE
region = '{{ region }}' AND
Identifier = '{{ backup_plan_id }}';
Lists all backup_plans in a region.
SELECT
region,
backup_plan_id
FROM awscc.backup.backup_plans_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new backup_plan resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.backup.backup_plans (
BackupPlan,
region
)
SELECT
'{{ backup_plan }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.backup.backup_plans (
BackupPlan,
BackupPlanTags,
region
)
SELECT
'{{ backup_plan }}',
'{{ backup_plan_tags }}',
'{{ 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: backup_plan
props:
- name: backup_plan
value:
backup_plan_name: '{{ backup_plan_name }}'
advanced_backup_settings:
- backup_options: {}
resource_type: '{{ resource_type }}'
backup_plan_rule:
- rule_name: '{{ rule_name }}'
target_backup_vault: '{{ target_backup_vault }}'
start_window_minutes: null
completion_window_minutes: null
schedule_expression: '{{ schedule_expression }}'
schedule_expression_timezone: '{{ schedule_expression_timezone }}'
index_actions:
- resource_types:
- '{{ resource_types[0] }}'
recovery_point_tags: {}
copy_actions:
- lifecycle:
move_to_cold_storage_after_days: null
delete_after_days: null
opt_in_to_archive_for_supported_resources: '{{ opt_in_to_archive_for_supported_resources }}'
destination_backup_vault_arn: '{{ destination_backup_vault_arn }}'
lifecycle: null
enable_continuous_backup: '{{ enable_continuous_backup }}'
- name: backup_plan_tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a backup_plan resource, using stack-deploy.
/*+ update */
UPDATE awscc.backup.backup_plans
SET PatchDocument = string('{{ {
"BackupPlan": backup_plan,
"BackupPlanTags": backup_plan_tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ backup_plan_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.backup.backup_plans
WHERE
Identifier = '{{ backup_plan_id }}' 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 backup_plans resource, the following permissions are required:
- Read
- Create
- Delete
- Update
- List
backup:GetBackupPlan,
backup:ListTags
backup:GetBackupPlan,
backup:TagResource,
backup:CreateBackupPlan
backup:GetBackupPlan,
backup:DeleteBackupPlan
backup:UpdateBackupPlan,
backup:ListTags,
backup:TagResource,
backup:UntagResource
backup:ListBackupPlans