# Upgrading the cloud node image

These instructions describe the steps to upgrade the cloud node image deployed on AWS or GCP up to the latest 6.x.

To upgrade the end‑of‑life node (3.6 or lower), please use the [different instructions](https://docs.wallarm.com/updating-migrating/older-versions/cloud-image.md).

## Requirements

* Access to the account with the **Administrator** role in Wallarm Console in the [US Cloud](https://us1.my.wallarm.com/) or [EU Cloud](https://my.wallarm.com/), or [ME Cloud](https://me1.my.wallarm.com/) 
* Access to `https://us1.api.wallarm.com` if working with US Wallarm Cloud or to `https://api.wallarm.com` if working with EU Wallarm Cloud, to `https://me1.api.wallarm.com` if working with ME Wallarm Cloud. Please ensure the access is not blocked by a firewall
* Access to the IP addresses and their corresponding hostnames (if any) listed below. This is needed for downloading updates to attack detection rules and API specifications, as well as retrieving precise IPs for your [allowlisted, denylisted, or graylisted](https://docs.wallarm.com/user-guides/ip-lists/overview.md) countries, regions, or data centers

    **US Cloud:**

    ```
    node-data0.us1.wallarm.com - 34.96.64.17
    node-data1.us1.wallarm.com - 34.110.183.149
    us1.api.wallarm.com - 35.235.66.155
    34.102.90.100
    34.94.156.115
    35.235.115.105
    ```

    **EU Cloud:**

    ```
    node-data1.eu1.wallarm.com - 34.160.38.183
    node-data0.eu1.wallarm.com - 34.144.227.90
    api.wallarm.com - 34.90.110.226
    ```

    **ME Cloud:**

    ```
    node-data0.me1.wallarm.com - 34.166.82.208
    node-data1.me1.wallarm.com - 34.166.82.208
    me1.api.wallarm.com - 34.166.82.208
    ```
## Step 1: Launch a new instance with the filtering node 6.x

1. Open the Wallarm filtering node image on the cloud platform marketplace and proceed to the image launch:
      * [Amazon Marketplace](https://aws.amazon.com/marketplace/pp/B073VRFXSD)
      * [GCP Marketplace](https://console.cloud.google.com/marketplace/details/wallarm-node-195710/wallarm-node)
2. At the launch step, set the following settings:

      * Select the image version `6.x.x`
      * For AWS, select the created security group in the field **Security Group Settings**
      * For AWS, select the name of the created key pair in the field **Key Pair Settings**
3. Confirm the instance launch.
4. For GCP, configure the instance following these [instructions](https://docs.wallarm.com/installation/cloud-platforms/gcp/machine-image.md#2-configure-the-filtering-node-instance).

## Step 2: Connect the filtering node to Wallarm Cloud

1. Connect to the filtering node instance via SSH. More detailed instructions for connecting to the instances are available in the cloud platform documentation:
      * [AWS documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstances.html)
      * [GCP documentation](https://cloud.google.com/compute/docs/instances/connecting-to-instance)
2. Create a new Wallarm node and connect it to the Wallarm Cloud using the generated token as described in the instructions for the cloud platform:
      * [AWS](https://docs.wallarm.com/installation/cloud-platforms/aws/ami.md#5-connect-the-instance-to-the-wallarm-cloud)
      * [GCP](https://docs.wallarm.com/installation/cloud-platforms/gcp/machine-image.md#5-connect-the-filtering-node-to-the-wallarm-cloud)

## Step 3: Copy the filtering node settings from the previous version to the new version

Copy the settings for processing and proxying requests from the following configuration files of the previous Wallarm node version to the files of the filtering node 6.x:

* `/etc/nginx/nginx.conf` and other files with NGINX settings
* `/etc/nginx/wallarm-status.conf` (or `/etc/nginx/conf.d/wallarm-status.conf`) with the filtering node monitoring service settings
* `/etc/environment` with environment variables
* any other custom configuration files for request processing and proxying, such as `/etc/nginx/sites-available/default`

Detailed information about working with NGINX configuration files is available in the [official NGINX documentation](https://nginx.org/docs/beginners_guide.html).

The list of filtering node directives is available [here](https://docs.wallarm.com/admin-en/configure-parameters-en.md).

## Step 4: Restart NGINX

Restart NGINX to apply the settings:

```bash
sudo systemctl restart nginx
```

## Step 5: Test Wallarm node operation

1. Send the request with test [Path Traversal](https://docs.wallarm.com/attacks-vulns-list.md#path-traversal) attack to a protected resource address:

    ```
    curl http://localhost/etc/passwd
    ```

    If traffic is configured to be proxied to `example.com`, include the `-H "Host: example.com"` header in the request.
1. Open Wallarm Console → **Attacks** section in the [US Cloud](https://us1.my.wallarm.com/attacks) or [EU Cloud](https://my.wallarm.com/attacks), or [ME Cloud](https://me1.my.wallarm.com/attacks) and make sure the attack is displayed in the list.

    ![Attacks in the interface](https://docs.wallarm.com/images/admin-guides/test-attacks-quickstart.png)

1. Optionally, [test](https://docs.wallarm.com/admin-en/uat-checklist-en.md) other aspects of the node functioning.
## Step 6: Create the virtual machine image based on the filtering node 6.x in AWS or GCP

To create the virtual machine image based on the filtering node 6.x, please follow the instructions for [AWS](https://docs.wallarm.com/admin-en/installation-guides/amazon-cloud/create-image.md) or [GCP](https://docs.wallarm.com/admin-en/installation-guides/google-cloud/create-image.md).

## Step 7: Delete the previous Wallarm node instance

If the new version of the filtering node is successfully configured and tested, remove the instance and virtual machine image with the previous version of the filtering node using the AWS or GCP management console.
