

# StartPlanExecution
<a name="API_StartPlanExecution"></a>

Starts 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.

## Request Parameters
<a name="API_StartPlanExecution_RequestParameters"></a>

 ** action **   
The action to perform. Valid values are `activate` (to shift traffic to the target Region) or `deactivate` (to shift traffic away from the target Region).  
Type: String  
Valid Values: `activate | deactivate | postRecovery`   
Required: Yes

 ** comment **   
An optional comment explaining why the plan execution is being started.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

 ** latestVersion **   
A boolean value indicating whether to use the latest version of the plan. If set to false, you must specify a specific version.  
Type: String  
Required: No

 ** mode **   
The plan execution mode. Valid values are `graceful`, for starting the execution in graceful mode, or `ungraceful`, for starting the execution in ungraceful mode.  
Type: String  
Valid Values: `graceful | ungraceful`   
Required: No

 ** planArn **   
The Amazon Resource Name (ARN) of the plan to execute.  
Type: String  
Pattern: `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})`   
Required: Yes

 ** recoveryExecutionId **   
The execution identifier of the recovery execution that ran in the opposite region post-recovery is ran in. Required when starting a post-recovery execution.  
Type: String  
Pattern: `[a-z]{2}(-[a-z]+)+-[0-9]+/[0-9a-fA-F]{16}`   
Required: No

 ** targetRegion **   
The AWS Region to target with this execution. This is the Region that traffic will be shifted to or from, depending on the action.  
Type: String  
Required: Yes

## Response Elements
<a name="API_StartPlanExecution_ResponseElements"></a>

The following elements are returned by the service.

 ** activateRegion **   
The AWS Region to activate.  
Type: String

 ** deactivateRegion **   
The AWS Region to deactivate.  
Type: String

 ** executionId **   
The execution identifier of a plan execution.  
Type: String

 ** plan **   
The details of the Region switch plan.  
Type: String  
Pattern: `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})` 

 ** planVersion **   
The version of the plan, a unique number generated by Region switch.  
Type: String

## Errors
<a name="API_StartPlanExecution_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403  
HTTP Status Code: 403

 ** IllegalArgumentException **   
The request processing has an invalid argument.  
HTTP Status Code: 400

 ** IllegalStateException **   
The operation failed because the current state of the resource doesn't allow the operation to proceed.  
HTTP Status Code: 400  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource was not found.  
HTTP Status Code: 404  
HTTP Status Code: 404

## See Also
<a name="API_StartPlanExecution_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/arc-region-switch-2022-07-26/StartPlanExecution) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/arc-region-switch-2022-07-26/StartPlanExecution) 