---
title: "Using Cloud Actions"
date: "2024-02-14T06:18:38+00:00"
summary: "Streamline DevOps tasks with Cloud Actions: Automate common processes during code deployment on Acquia Cloud Platform."
image:
type: "page"
url: "/acquia-cloud-platform/using-cloud-actions"
id: "89bc8cb8-8da0-4b63-b5cb-9c226f6852cf"
---

Table of contents will be added

Note

This feature is available only on:

*   Environments running on [Cloud Next](/acquia-cloud-platform) technologies,
*   Non-Drupal 7 applications,
*   Single sites and not multi-sites, using the `default` folder.

Cloud Actions is a feature of Cloud Platform that automatically executes common DevOps tasks whenever code is deployed to an environment. You can select one or more Cloud Actions whenever you initiate a deployment, or can configure default actions on each environment. You can enable these actions through the Cloud Platform user interface without requiring any custom code or command line tools.

Acquia provides a list of predefined Cloud Actions. They are executed in a predefined order as represented in the Cloud Platform user interface. The order cannot be changed. Post-deployment Cloud Actions always execute after completion of `post-code-deploy` [Cloud Hooks](https://github.com/acquia/cloud-hooks "https://github.com/acquia/cloud-hooks").

With this feature, you can:

*   Select and execute actions through the Cloud Platform user interface without requiring any custom code or command line tools
*   Set default actions on each environment
*   Override default actions on each code deployment

Terminology
-----------

The following table lists the terms specific to Cloud Actions:

**Term**

**Description**

**Action**

A specific task that is executed before or after a code deployment.

**Environment**

A Cloud Platform environment to which a code is deployed. For example, development, stage, and production.

**Configuration**

Cloud Actions-specific settings configured by the application administrator.

**Default configuration**

Environment-level default settings for Cloud Actions.

**Pre-deployment**

An action that takes place before a code deployment.

**Post-deployment**

An action that takes place after a code deployment.

Available Cloud Actions
-----------------------

The following table lists all available Cloud Actions in the order in which they run if selected:

**Order**

**Cloud Action**

**Description**

**Type**

**Drupal Version Compatibility**

1

Backup all databases

Creates a backup of all databases in the target environment. For more information, see [Taking backups](/acquia-cloud-platform/manage-apps/back-up).

Pre-deployment

All

2

Turn on Drupal maintenance mode

Enables Drupal maintenance mode. For more information, see [Drupal documentation](https://www.drupal.org/docs/user_guide/en/extend-maintenance.html).

Pre-deployment

All

3

Clear all Drupal caches

Clears and rebuilds all Drupal caches before deployment. This does not clear Varnish or CDN caches. This effectively runs `drush cache-rebuild` for the [current Drupal version](/service-offerings/guide/software-life-cycle#supported-drupal-version), and `drush cc all` for Drupal 7. For more information, see [Drupal documentation](https://www.drupal.org/docs/user_guide/en/prevent-cache-clear.html).

Pre-deployment

All

4

Run database updates

Runs database updates for the Drupal application. This effectively runs `drush update-db`. For more information, see [Drush documentation](https://www.drush.org/latest/commands/updatedb/).

Post-deployment

All

5

Import configuration

Imports configuration. This effectively runs `drush config-import`. The system runs this command twice to avoid a known bug. For more information about this bug, visit [Config import sometimes needs be run several times to fully sync](https://www.drupal.org/project/drupal/issues/3241439). For more information about the Drush command, visit [Drush documentation](https://www.drush.org/latest/commands/config_import/).

Post-deployment

[Current Drupal version](/service-offerings/guide/software-life-cycle#supported-drupal-version)

6

Sanitize database

Sanitizes the database. You can use [Drush hooks](https://www.drush.org/latest/hooks/) to extend and customize this command. This effectively runs `drush sql-sanitize`. For more information, see [Drush documentation](https://www.drush.org/latest/commands/sql_sanitize/).

Post-deployment

All

7

Clear all Drupal caches

Clears and rebuilds all Drupal caches after deployment. This does not clear Varnish or CDN caches. This effectively runs `drush cache-rebuild` for the [current Drupal version](/service-offerings/guide/software-life-cycle#supported-drupal-version), and `drush cc all` for Drupal 7. For more information, see [Drupal documentation](https://www.drupal.org/docs/user_guide/en/prevent-cache-clear.html).

Post-deployment

All

8

Clear all Varnish caches

Clears all Varnish caches. For more information, see [Purging Varnish cache on Cloud Platform](/acquia-cloud-platform/performance/varnish/purging).

Post-deployment

All

9

Clear external caches

Clears external caches. This requires enabling the [Purge](https://drupal.org/project/purge) module and its sub-module `purge_drush`.

Post-deployment

All

10

Turn off Drupal maintenance mode

Disables Drupal maintenance mode. For more information, see [Drupal documentation](https://www.drupal.org/docs/user_guide/en/extend-maintenance.html).

Post-deployment

All

Enabling Cloud Actions
----------------------

By default, Cloud Actions are disabled on all environments.

To enable Cloud Actions on an environment:

1.  From your Cloud Platform account, go to the environment on which you want to enable Cloud Actions.
2.  Click **Configuration**.
3.  Click the **Cloud Actions** tab.
4.  Select the **Enable Cloud Actions on this environment** checkbox.
    
    ![cloud-platform_enabling-cloud-actions.jpg](https://acquia.widen.net/content/ee907c9b-85cb-42ea-a328-157f8d5cca15/web/cloud-platform_enabling-cloud-actions.jpg)
    
    For further customization of Cloud Actions, you can select default Cloud Actions during enablement.
    
5.  Select the default Cloud Actions that must automatically run for each code deployment on this environment.
    *   To select all Cloud Actions, select the checkbox next to **Cloud Actions**.
    *   To select Cloud Actions individually, select the checkbox for each Cloud Action that you want to run as a default whenever a deployment is initiated on your environment.
6.  Click **Save**.
    
    ![cloud-platform_updating-cloud-actions.jpg](https://acquia.widen.net/content/0c5631f5-b8b9-4554-8f5b-cd80fa4bf7a8/web/cloud-platform_updating-cloud-actions.jpg)
    
    Cloud Actions are selectable upon deployment or code switch. The default Cloud Actions are preselected during deployment while still being overridable. The order in which Cloud Actions are displayed in the list is the order in which they run.
    
7.  (_Optional_) Hover over the information bubble to view the description of a Cloud Action.
    
    ![cloud-platform_hovering-over-the-information-bubble.jpg](https://acquia.widen.net/content/e8375732-a94b-4c8b-8ba6-1a96551e69ef/web/cloud-platform_hovering-over-the-information-bubble.jpg)
    
    Note
    
    You must select the **Enable Cloud Actions on this environment** checkbox so that Cloud Actions are available upon initiated deployment. After enablement, you can still select which Cloud Actions run on per deployment.
    

Disabling Cloud Actions
-----------------------

To disable Cloud Actions:

1.  From your Cloud Platform account, go to the environment you want to disable Cloud Actions.
2.  Click **Configuration**.
3.  Click the **Cloud Actions** tab.
4.  Clear the **Enable Cloud Actions on this environment** checkbox.
5.  Click **Save**.

Configuring Cloud Actions upon deployment
-----------------------------------------

After you enable Cloud Actions and set your defaults, you can also select which Cloud Actions run upon initiate deployment or override the defaults you enabled. Cloud Actions are displayed within the code deployment modal window after the step of selecting which code to deploy.

Note

You can only use Cloud Actions when you start deployments through one of the following ways: 

*   Switch branches.
*   Drag and drop in the Cloud Platform user interface. 

Cloud Actions does not work for automatic deployments started by the `Follow Branch` updates.

Selecting Cloud Actions
-----------------------

To select Cloud Actions:

1.  Click **Edit** to modify the Cloud Actions.
2.  Select or clear the checkbox of the Cloud Actions that must run after the deployment is initiated.
3.  Click **Confirm** to establish the Cloud Actions that you want to run.
    
    ![Acquia Cloud Platform user interface showing a 'Deploy code to Production' dialog box. The dialog box displays source and target environments, optional commit message field, and Cloud Actions checklist including database backup, Drupal maintenance mode, and database updates.](https://acquia.widen.net/content/cdaa92c5-58c9-4df2-9799-b6abd3b424b7/web/cloud-platform_confirming-cloud-action.jpg)
    
4.  Click **Deploy**.
    
    Cloud Actions run in the predetermined order.