plans
Creates, updates, deletes or gets a plan resource or lists plans in a region
Overview
| Name | plans |
| Type | Resource |
| Description | Represents a plan that specifies Regions, IAM roles, and workflows of logic required to perform the desired change to your multi-Region application |
| Id | awscc.arcregionswitch.plans |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | |
associated_alarms | object | |
description | string | |
execution_role | string | |
name | string | |
owner | string | |
primary_region | string | |
recovery_approach | string | |
recovery_time_objective_minutes | number | |
regions | array | |
tags | object | |
triggers | array | |
version | string | |
workflows | array | |
health_checks_for_plan | object | |
route53_health_checks | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | |
region | string | AWS region. |
For more information, see AWS::ARCRegionSwitch::Plan.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | plans | INSERT | ExecutionRole, Name, RecoveryApproach, Regions, Workflows, region |
delete_resource | plans | DELETE | Identifier, region |
update_resource | plans | UPDATE | Identifier, PatchDocument, region |
list_resources | plans_list_only | SELECT | region |
get_resource | plans | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual plan.
SELECT
region,
arn,
associated_alarms,
description,
execution_role,
name,
owner,
primary_region,
recovery_approach,
recovery_time_objective_minutes,
regions,
tags,
triggers,
version,
workflows,
health_checks_for_plan,
route53_health_checks
FROM awscc.arcregionswitch.plans
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all plans in a region.
SELECT
region,
arn
FROM awscc.arcregionswitch.plans_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new plan resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.arcregionswitch.plans (
ExecutionRole,
Name,
RecoveryApproach,
Regions,
Workflows,
region
)
SELECT
'{{ execution_role }}',
'{{ name }}',
'{{ recovery_approach }}',
'{{ regions }}',
'{{ workflows }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.arcregionswitch.plans (
AssociatedAlarms,
Description,
ExecutionRole,
Name,
PrimaryRegion,
RecoveryApproach,
RecoveryTimeObjectiveMinutes,
Regions,
Tags,
Triggers,
Workflows,
region
)
SELECT
'{{ associated_alarms }}',
'{{ description }}',
'{{ execution_role }}',
'{{ name }}',
'{{ primary_region }}',
'{{ recovery_approach }}',
'{{ recovery_time_objective_minutes }}',
'{{ regions }}',
'{{ tags }}',
'{{ triggers }}',
'{{ workflows }}',
'{{ 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: plan
props:
- name: associated_alarms
value: {}
- name: description
value: '{{ description }}'
- name: execution_role
value: '{{ execution_role }}'
- name: name
value: '{{ name }}'
- name: primary_region
value: '{{ primary_region }}'
- name: recovery_approach
value: '{{ recovery_approach }}'
- name: recovery_time_objective_minutes
value: null
- name: regions
value:
- '{{ regions[0] }}'
- name: tags
value: {}
- name: triggers
value:
- description: '{{ description }}'
target_region: '{{ target_region }}'
action: '{{ action }}'
conditions:
- associated_alarm_name: '{{ associated_alarm_name }}'
condition: '{{ condition }}'
min_delay_minutes_between_executions: null
- name: workflows
value:
- steps:
- name: '{{ name }}'
description: '{{ description }}'
execution_block_configuration: null
execution_block_type: '{{ execution_block_type }}'
workflow_target_action: null
workflow_target_region: '{{ workflow_target_region }}'
workflow_description: '{{ workflow_description }}'
UPDATE example
Use the following StackQL query and manifest file to update a plan resource, using stack-deploy.
/*+ update */
UPDATE awscc.arcregionswitch.plans
SET PatchDocument = string('{{ {
"AssociatedAlarms": associated_alarms,
"Description": description,
"ExecutionRole": execution_role,
"RecoveryTimeObjectiveMinutes": recovery_time_objective_minutes,
"Tags": tags,
"Triggers": triggers,
"Workflows": workflows
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.arcregionswitch.plans
WHERE
Identifier = '{{ 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 plans resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
arc-region-switch:CreatePlan,
arc-region-switch:GetPlan,
arc-region-switch:ListRoute53HealthChecks,
arc-region-switch:ListTagsForResource,
arc-region-switch:TagResource,
iam:PassRole
arc-region-switch:GetPlan,
arc-region-switch:ListRoute53HealthChecks,
arc-region-switch:ListTagsForResource
arc-region-switch:GetPlan,
arc-region-switch:ListRoute53HealthChecks,
arc-region-switch:ListTagsForResource,
arc-region-switch:TagResource,
arc-region-switch:UntagResource,
arc-region-switch:UpdatePlan,
iam:PassRole
arc-region-switch:DeletePlan,
arc-region-switch:GetPlan
arc-region-switch:ListPlans