resiliency_policies
Creates, updates, deletes or gets a resiliency_policy resource or lists resiliency_policies in a region
Overview
| Name | resiliency_policies |
| Type | Resource |
| Description | Resource Type Definition for Resiliency Policy. |
| Id | awscc.resiliencehub.resiliency_policies |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
policy_name | string | Name of Resiliency Policy. |
policy_description | string | Description of Resiliency Policy. |
data_location_constraint | string | Data Location Constraint of the Policy. |
tier | string | Resiliency Policy Tier. |
policy | object | |
policy_arn | string | Amazon Resource Name (ARN) of the Resiliency Policy. |
tags | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
policy | object | |
policy_arn | string | Amazon Resource Name (ARN) of the Resiliency Policy. |
region | string | AWS region. |
For more information, see AWS::ResilienceHub::ResiliencyPolicy.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | resiliency_policies | INSERT | PolicyName, Tier, Policy, region |
delete_resource | resiliency_policies | DELETE | Identifier, region |
update_resource | resiliency_policies | UPDATE | Identifier, PatchDocument, region |
list_resources | resiliency_policies_list_only | SELECT | region |
get_resource | resiliency_policies | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual resiliency_policy.
SELECT
region,
policy_name,
policy_description,
data_location_constraint,
tier,
policy,
policy_arn,
tags
FROM awscc.resiliencehub.resiliency_policies
WHERE
region = '{{ region }}' AND
Identifier = '{{ policy_arn }}';
Lists all resiliency_policies in a region.
SELECT
region,
policy_arn
FROM awscc.resiliencehub.resiliency_policies_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new resiliency_policy resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.resiliencehub.resiliency_policies (
PolicyName,
Tier,
Policy,
region
)
SELECT
'{{ policy_name }}',
'{{ tier }}',
'{{ policy }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.resiliencehub.resiliency_policies (
PolicyName,
PolicyDescription,
DataLocationConstraint,
Tier,
Policy,
Tags,
region
)
SELECT
'{{ policy_name }}',
'{{ policy_description }}',
'{{ data_location_constraint }}',
'{{ tier }}',
'{{ policy }}',
'{{ 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: resiliency_policy
props:
- name: policy_name
value: '{{ policy_name }}'
- name: policy_description
value: '{{ policy_description }}'
- name: data_location_constraint
value: '{{ data_location_constraint }}'
- name: tier
value: '{{ tier }}'
- name: policy
value:
az:
rto_in_secs: '{{ rto_in_secs }}'
rpo_in_secs: '{{ rpo_in_secs }}'
hardware: null
software: null
region: null
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a resiliency_policy resource, using stack-deploy.
/*+ update */
UPDATE awscc.resiliencehub.resiliency_policies
SET PatchDocument = string('{{ {
"PolicyName": policy_name,
"PolicyDescription": policy_description,
"DataLocationConstraint": data_location_constraint,
"Tier": tier,
"Policy": policy,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ policy_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.resiliencehub.resiliency_policies
WHERE
Identifier = '{{ policy_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 resiliency_policies resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
resiliencehub:CreateResiliencyPolicy,
resiliencehub:DescribeResiliencyPolicy,
resiliencehub:TagResource
resiliencehub:DescribeResiliencyPolicy,
resiliencehub:UpdateResiliencyPolicy,
resiliencehub:TagResource,
resiliencehub:UntagResource,
resiliencehub:ListTagsForResource
resiliencehub:DescribeResiliencyPolicy,
resiliencehub:ListTagsForResource
resiliencehub:DeleteResiliencyPolicy,
resiliencehub:UntagResource
resiliencehub:ListResiliencyPolicies