

# Post-launch settings
Post-launch settings

Post-launch settings allow you to control and automate actions performed after a recovery instance has been launched for the source server in AWS. These settings are created automatically based on the **Default post-launch actions**.

**Activating the post-launch actions for a specific source server**:
+ Navigate to the **Source servers** page and select a source server.
+ Go to the **Post-launch settings** tab. If **Post launch action settings** has **Post launch actions** set to **Active**, click **Edit** for **Post launch action settings**.
+ You will be redirected to the **Edit post-launch settings** screen. Make sure the **Post-launch actions active** option is not checked and click **Save**.

 Alternatively, you can activate and deactivate post-launch actions for multiple servers by navigating to the **Source servers** page, selecting the servers you want to update and clicking **Actions > Edit post-launch action settings**. To activate, make sure the **Post-launch actions active** option is checked, and to deactivate, it should be unchecked. If you made a change, click **Save**. 

**Topics**
+ [

# Adding custom actions with AWS DRS
](post-launch-action-settings-adding-custom-source.md)
+ [

# Activating, deactivating, and editing predefined or custom actions
](post-launch-action-settings-editing-source.md)
+ [

# Deleting custom actions
](post-launch-action-settings-deleting-source.md)
+ [

# Predefined post-launch actions
](predefined-post-launch-actions-source.md)

# Adding custom actions with AWS DRS
Adding custom actions

 AWS Elastic Disaster Recovery (AWS DRS) allows you to run any SSM document that you like – public SSM documents, SSM documents that you created and uploaded to your account or SSM documents that are shared with you. You can configure a custom action to run any SSM document that is available in your account. To be able to create, edit or delete a custom action, make sure the post-launch actions are activated for this source server. Custom actions added to the default settings are automatically added to newly added source servers. 

## Create a custom action


Adding a custom action through source server’s **Post-launch settings**, adds it to this source server. To add a custom action to all newly added source servers, use the **Settings → Default post-launch actions** page. To add a new custom action to the source server, go to **Source server details → Post-launch settings** tab. If the **Post-launch actions** post-launch actions settings is **Active**, you can create new custom actions by clicking on the **Add action** button. 

The **Add action** page includes these parameters:
+ **Action name** – The name of the action in AWS DRS, which should be intuitive, meaningful and unique in this AWS account and region.
+ **Activate this action** – Use this checkbox to activate or deactivate the custom action for this source server. Only active actions run after the launch of a recovery instance.
+ **Mark launch as successful only if this action finishes running successfully** – This checkbox dictates whether or not the launch is marked as successful, based on the successful run of this action. Instance launches progress normally regardless of the success of the action.
+ **System Manager document name** – Select any Systems Manager document that is available to be used in this account.
+ **View in Systems Manager** – Click to open **System Managers** and view additional information about the document.
+ **Description** – Add a description or keep the default.
+ **Document version** – Select which SSM document version to run. AWS DRS can run a default version, the latest version, or a specific version, according to your preferences.
+ **Category** – Select from various available categories including monitoring, validation, security and more.
+ **Order** – Specify the order in which the actions are executed. The lower the number, the earlier the action is executed. Values allowed are between 2 and 10,000. The numbers must be unique but don’t need to be consecutive.
+ **Platform** – Taken from the SSM document and reports which Operating System platform (Windows/Linux) is supported by the action. 
+ **Creator** – Who created the action. For custom actions, the default is always **This account**.

 The **Action parameters** change according to the specific SSM document that is selected. Note that for the instance ID parameter, you can choose to use the launch instance ID, in which case, AWS DRS dynamically populates the value. 

**Note**  
 AWS Elastic Disaster Recovery (AWS DRS) places **AWSElasticDisasterRecoveryRecoveryInstanceWithLaunchActionsRole** instance profile on the launch instance if post-launch actions is active for the source server. If you add an SSM command action that requires additional permissions in the launch instance, you must ensure that the instance profile has the right policies or the right permissions. In order to do so, create a role that has the required permissions as per the policies above or has a policy or policies with those permissions attached to it. Go to **Launch settings** > **EC2 launch template** > **Modify** > **Advance** > **IAM instance profile**. Use an existing profile or create a new one using the **Create new IAM profile** link. 

**Note**  
 Only trusted, authorized users should have access to the parameter store. For enhanced security, ensure that users who do not have permissions to execute SSM documents / commands, do not have access to parameter store. [Learn more about restricting access to Systems Manager parameters](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-access.html). Action parameters are stored in the SSM parameter store as regular strings. Changing parameters in the SSM Parameter store may impact the post launch action run on target instances. We recommend to consider security implications, when choosing to use parameters that contain scripts or sensitive information, such as API keys and database passwords. 

# Activating, deactivating, and editing predefined or custom actions


 You can activate, deactivate and edit actions available for this source server. Activating an action ensures it runs after launching a recovery instance. Likewise, deactivating it, prevents it from being run after launching a recovery instance. The default settings are not affected by activating, deactivating or editing an action for a source server. Editing an action for a source server updates it for that source server. These changes are not reflected on the action, if it exists in the default post-launch actions settings. Changes to actions in the default settings, as to apply to newly added source servers, can be done from the **Settings → Default post-launch actions** page. 

To be able to activate, create, deactivate, edit, or delete a custom action and to activate, deactivate or edit predefined actions for a source server, make sure the post-launch actions are activated for that source server.

## Activating, deactivating and editing predefined or custom actions


 To activate, deactivate or edit a post launch action in the default post-launch actions settings, go to **Source server details** page, and visit the **Post-launch settings** tab. If **Post-launch actions settings** shows **Post-launch actions** to be **Active**, you can edit any action defined for the source server. 

Locate the action you want to edit in the **Actions** card view, or use the search field to filter the actions by name.

Choose the action’s card to select it, and then choose the **Edit** button.

 To activate the action, make sure the **Activate this action setting** is checked and click the **Save** button. To deactivate, make sure the **Activate this action** setting is un-checked and click the **Save** button. 

 The edit page allow you to change the value of some of the parameters for both pre-defined actions and custom actions. Some parameters can only be edited if the action is a custom action. See below for specific information. 

The parameters that appear on the edit page:
+ **Action name** – Editable for custom actions. The name of the action in AWS DRS, which should be intuitive, meaningful and unique in this AWS account and region.
+ **Activate this action** – Use this checkbox to activate or deactivate the action for this source server. Only active actions run after the launch of a recovery instance.
+ **Mark launch as successful only if this action finishes running successfully** – This checkbox dictates whether or not the launch is marked as successful, based on the successful run of this action. Instances launches progress normally regardless of the success of the action.
+ **System Manager document name** – Editable for custom actions. Select any Systems Manager document that is available to be used in this account.
+ **View in Systems Manager** – Click to open **System Managers** and view additional information about the document.
+ **Description** – Editable for custom actions. Add a description or keep the default.
+ **Document version** – Editable for custom actions. Select which SSM document version to run. AWS DRS can run a default version, the latest version, or a specific version, according to your preferences.
+ **Category** – Editable for custom actions. Select from various available categories including monitoring, validation, security and more.
+ **Order** – Specify the order in which the actions run. The lower the number, the earlier the action runs. Values allowed are between 2 and 10,000. The numbers must be unique but don’t need to be consecutive.
+ **Platform** – Not editable. Taken from the SSM document and reports which Operating System platform (Windows/Linux) is supported by the action. 
+ **Creator** – Not editable. Who created the action. For custom actions, the default is always **This account**.

 The **Action parameters** change according to the specific SSM document that is selected. Note that for the instance ID parameter, you can choose to use the launch instance ID, in which case, AWS DRS dynamically populates the value. Some predefined actions, where applicable allow to use a dynamically populated value for the volumes. This value is dynamically populated by AWS DRS with the volumes of the instance being launched. 

After making the required changes, click **Save**, to save the changes and **Cancel** to abort them.

# Deleting custom actions


 Custom actions added to a source server from the default settings on creation or created later for that source server can also be deleted. Deleting a custom action for a source server removes it from that source server and means the action is no longer available to that source server. Deleting the action for a source server does not remove it from the default settings if the action was defined there as well. To delete a custom action from the default settings to avoid adding it to newly added source servers, go to the **Settings → Default post-launch actions** page, and delete the action from there. Pre-defined actions cannot be deleted. If a pre-defined action is not required, it can be deactivated. 

 Locate the action you want to delete in the **Actions** card view, or use the search field to filter the actions by name. Select the action, and click the **Delete** button. To confirm, press **Delete**. 

# Predefined post-launch actions


 AWS Elastic Disaster Recovery allows you to run various predefined post-launch actions on your EC2 launched instance. Use these out-of-the-box actions to improve your launch flexibility. 

These actions can be activated, edited or deactivated for a specific source servers.

[List of available pre-defined actions](https://docs.aws.amazon.com/drs/latest/userguide/predefined-post-launch-actions-default.html)