plan_executions
Creates, updates, deletes, gets or lists a plan_executions resource.
Overview
| Name | plan_executions |
| Type | Resource |
| Id | aws.arc_region_switch.plan_executions |
Fields
The following fields are returned by SELECT queries:
- get_plan_execution
- list_plan_executions
| Name | Datatype | Description |
|---|---|---|
name | string | The name of a step in a workflow. |
end_time | string (date-time) | The timestamp when a step endeded execution. |
start_time | string (date-time) | The timestamp when a step started execution. |
status | string | The status of a step in a workflow. For example, a status might be Completed or Pending Approval. (notStarted, running, failed, completed, canceled, skipped, pendingApproval) |
step_mode | string | The mode for a step execution. The mode can be Graceful or Ungraceful. (graceful, ungraceful) |
| Name | Datatype | Description |
|---|---|---|
actual_recovery_time | string | The actual recovery time that Region switch calculates for a plan execution. Actual recovery time includes the time for the plan to run added to the time elapsed until the application health alarms that you've specified are healthy again. (pattern: <code>P(?!$)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?</code>) |
comment | string | An optional comment about the plan execution. |
end_time | string (date-time) | The timestamp when the plan execution was ended. |
execution_action | string | The plan execution action. Valid values are activate, to activate an Amazon Web Services Region, or deactivate, to deactivate a Region. (activate, deactivate, postRecovery) |
execution_id | string | The execution identifier of a plan execution. |
execution_region | string | The Amazon Web Services Region for a plan execution. |
execution_state | string | The plan execution state. Provides the state of a plan execution, for example, In Progress or Paused by Operator. (inProgress, pausedByFailedStep, pausedByOperator, completed, completedWithExceptions, canceled, planExecutionTimedOut, pendingManualApproval, failed, pending, completedMonitoringApplicationHealth) |
mode | string | The plan execution mode. Valid values are graceful, for graceful executions, or ungraceful, for ungraceful executions. (graceful, ungraceful) |
plan_arn | string | The 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>) |
recovery_execution_id | string | The unique identifier of the most recent recovery execution. Required when starting a post-recovery execution. |
start_time | string (date-time) | The timestamp when the plan execution was started. |
updated_at | string (date-time) | The timestamp when the plan execution was last updated. |
version | string | The version for the plan. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_plan_execution | select | region | Retrieves detailed information about a specific plan execution. You must specify the plan ARN and execution ID. | |
list_plan_executions | select | region | Lists the executions of a Region switch plan. This operation returns information about both current and historical executions. | |
update_plan_execution_step | update | region, planArn, executionId, comment, stepName, actionToTake | Updates a specific step in an in-progress plan execution. This operation allows you to modify the step's comment or action. | |
update_plan_execution | update | region, planArn, executionId, action | Updates an in-progress plan execution. This operation allows you to modify certain aspects of the execution, such as adding a comment or changing the action. | |
approve_plan_execution_step | exec | region, planArn, executionId, stepName, approval | Approves a step in a plan execution that requires manual approval. When you create a plan, you can include approval steps that require manual intervention before the execution can proceed. This operation allows you to provide that approval. You must specify the plan ARN, execution ID, step name, and approval status. You can also provide an optional comment explaining the approval decision. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_plan_execution
- list_plan_executions
Retrieves detailed information about a specific plan execution. You must specify the plan ARN and execution ID.
SELECT
name,
end_time,
start_time,
status,
step_mode
FROM aws.arc_region_switch.plan_executions
WHERE region = '{{ region }}' -- required
;
Lists the executions of a Region switch plan. This operation returns information about both current and historical executions.
SELECT
actual_recovery_time,
comment,
end_time,
execution_action,
execution_id,
execution_region,
execution_state,
mode,
plan_arn,
recovery_execution_id,
start_time,
updated_at,
version
FROM aws.arc_region_switch.plan_executions
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- update_plan_execution_step
- update_plan_execution
Updates a specific step in an in-progress plan execution. This operation allows you to modify the step's comment or action.
UPDATE aws.arc_region_switch.plan_executions
SET
planArn = '{{ planArn }}',
executionId = '{{ executionId }}',
comment = '{{ comment }}',
stepName = '{{ stepName }}',
actionToTake = '{{ actionToTake }}'
WHERE
region = '{{ region }}' --required
AND planArn = '{{ planArn }}' --required
AND executionId = '{{ executionId }}' --required
AND comment = '{{ comment }}' --required
AND stepName = '{{ stepName }}' --required
AND actionToTake = '{{ actionToTake }}' --required;
Updates an in-progress plan execution. This operation allows you to modify certain aspects of the execution, such as adding a comment or changing the action.
UPDATE aws.arc_region_switch.plan_executions
SET
planArn = '{{ planArn }}',
executionId = '{{ executionId }}',
action = '{{ action }}',
comment = '{{ comment }}'
WHERE
region = '{{ region }}' --required
AND planArn = '{{ planArn }}' --required
AND executionId = '{{ executionId }}' --required
AND action = '{{ action }}' --required;
Lifecycle Methods
- approve_plan_execution_step
Approves a step in a plan execution that requires manual approval. When you create a plan, you can include approval steps that require manual intervention before the execution can proceed. This operation allows you to provide that approval. You must specify the plan ARN, execution ID, step name, and approval status. You can also provide an optional comment explaining the approval decision.
EXEC aws.arc_region_switch.plan_executions.approve_plan_execution_step
@region='{{ region }}' --required
@@json=
'{
"planArn": "{{ planArn }}",
"executionId": "{{ executionId }}",
"stepName": "{{ stepName }}",
"approval": "{{ approval }}",
"comment": "{{ comment }}"
}'
;