Skip to main content

plans

Creates, updates, deletes, gets or lists a plans resource.

Overview

Nameplans
TypeResource
Idaws.arc_region_switch.plans

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name for a plan. (pattern: <code>[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,30}[a-zA-Z0-9])?</code>)
arnstringThe Amazon Resource Name (ARN) of the plan. (pattern: <code>arn:aws[a-zA-Z-]*:arc-region-switch::[0-9]{12}:plan/([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,30}[a-zA-Z0-9])?):([a-z0-9]{6})</code>)
associated_alarmsobjectThe associated application health alarms for a plan.
descriptionstringThe description for a plan.
execution_rolestringThe execution role for a plan. (pattern: <code>arn:aws[a-zA-Z0-9-]*:iam::[0-9]{12}:role/.+</code>)
ownerstringThe owner of a plan. (pattern: <code>\d{12}</code>)
primary_regionstringThe primary Region for a plan. (pattern: <code>[a-z]{2}-[a-z-]+-\d+</code>)
recovery_approachstringThe recovery approach for a Region switch plan, which can be active/active (activeActive) or active/passive (activePassive). (activeActive, activePassive)
recovery_time_objective_minutesintegerThe recovery time objective for a plan.
regionsarrayThe Amazon Web Services Regions for a plan.
report_configurationobjectConfiguration for automatic report generation for plan executions. When configured, Region switch automatically generates a report after each plan execution that includes execution events, plan configuration, and CloudWatch alarm states.
triggersarrayThe triggers for a plan.
updated_atstring (date-time)The timestamp when the plan was last updated.
versionstringThe version for the plan.
workflowsarrayThe workflows for a plan.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_planselectregionRetrieves detailed information about a Region switch plan. You must specify the ARN of the plan.
list_plansselectregionLists all Region switch plans in your Amazon Web Services account.
create_planinsertregion, workflows, executionRole, name, regions, recoveryApproachCreates a new Region switch plan. A plan defines the steps required to shift traffic from one Amazon Web Services Region to another. You must specify a name for the plan, the primary Region, and at least one additional Region. You can also provide a description, execution role, recovery time objective, associated alarms, triggers, and workflows that define the steps to execute during a Region switch.
update_planupdateregion, arn, workflows, executionRoleUpdates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.
delete_plandeleteregionDeletes a Region switch plan. You must specify the ARN of the plan to delete. You cannot delete a plan that has an active execution in progress.
cancel_plan_executionexecregion, planArn, executionIdCancels an in-progress plan execution. This operation stops the execution of the plan and prevents any further steps from being processed. You must specify the plan ARN and execution ID. You can also provide an optional comment explaining why the execution was canceled.
start_plan_executionexecregion, planArn, targetRegion, actionStarts the execution of a Region switch plan. You can execute a plan in either graceful or ungraceful mode. Specifing ungraceful mode either changes the behavior of the execution blocks in a workflow or skips specific execution blocks.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves detailed information about a Region switch plan. You must specify the ARN of the plan.

SELECT
name,
arn,
associated_alarms,
description,
execution_role,
owner,
primary_region,
recovery_approach,
recovery_time_objective_minutes,
regions,
report_configuration,
triggers,
updated_at,
version,
workflows
FROM aws.arc_region_switch.plans
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new Region switch plan. A plan defines the steps required to shift traffic from one Amazon Web Services Region to another. You must specify a name for the plan, the primary Region, and at least one additional Region. You can also provide a description, execution role, recovery time objective, associated alarms, triggers, and workflows that define the steps to execute during a Region switch.

INSERT INTO aws.arc_region_switch.plans (
description,
workflows,
executionRole,
recoveryTimeObjectiveMinutes,
associatedAlarms,
triggers,
reportConfiguration,
name,
regions,
recoveryApproach,
primaryRegion,
tags,
region
)
SELECT
'{{ description }}',
'{{ workflows }}' /* required */,
'{{ executionRole }}' /* required */,
{{ recoveryTimeObjectiveMinutes }},
'{{ associatedAlarms }}',
'{{ triggers }}',
'{{ reportConfiguration }}',
'{{ name }}' /* required */,
'{{ regions }}' /* required */,
'{{ recoveryApproach }}' /* required */,
'{{ primaryRegion }}',
'{{ tags }}',
'{{ region }}'
RETURNING
plan
;

UPDATE examples

Updates an existing Region switch plan. You can modify the plan's description, workflows, execution role, recovery time objective, associated alarms, and triggers.

UPDATE aws.arc_region_switch.plans
SET
arn = '{{ arn }}',
description = '{{ description }}',
workflows = '{{ workflows }}',
executionRole = '{{ executionRole }}',
recoveryTimeObjectiveMinutes = {{ recoveryTimeObjectiveMinutes }},
associatedAlarms = '{{ associatedAlarms }}',
triggers = '{{ triggers }}',
reportConfiguration = '{{ reportConfiguration }}'
WHERE
region = '{{ region }}' --required
AND arn = '{{ arn }}' --required
AND workflows = '{{ workflows }}' --required
AND executionRole = '{{ executionRole }}' --required
RETURNING
plan;

DELETE examples

Deletes a Region switch plan. You must specify the ARN of the plan to delete. You cannot delete a plan that has an active execution in progress.

DELETE FROM aws.arc_region_switch.plans
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Cancels an in-progress plan execution. This operation stops the execution of the plan and prevents any further steps from being processed. You must specify the plan ARN and execution ID. You can also provide an optional comment explaining why the execution was canceled.

EXEC aws.arc_region_switch.plans.cancel_plan_execution
@region='{{ region }}' --required
@@json=
'{
"planArn": "{{ planArn }}",
"executionId": "{{ executionId }}",
"comment": "{{ comment }}"
}'
;