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 = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all plans in a region.
SELECT
region,
arn
FROM awscc.arcregionswitch.plans_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ 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 }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.arcregionswitch.plans
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
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