Remove your AWS environment

You can remove your AWS environment from Sophos Cloud Optix.


There are three methods of removing an AWS environment:

  • Use Sophos Cloud Optix.
  • Use an AWS CLI script, if you don't have access to Sophos Cloud Optix.
  • Use Terraform, if the environment was added with Terraform.

Using the Sophos Cloud Optix console

Removing an AWS environment with the console.

Do as follows:

  1. Go to Settings > Environments.
  2. Follow the instructions.

Using an AWS CLI script

You can remove an AWS environment with a script provided by Sophos.

This method is useful if you can't access the Sophos Cloud Optix console. Do as follows:

  1. From the AWS CLI download the script to your system.

    Enter the following command: curl -s "" -o

  2. Run the script using the command: bash

The script removes the environment from Sophos Cloud Optix and removes the Sophos Cloud Optix resources from your AWS environment.

Using Terraform

You can remove environments you created with Terraform.

When you add an AWS environment to Sophos Cloud Optix using Terraform, a .tfstate is created, with details of the resources that were created. If the .tfstate still exists you can remove the environment. To do this use the terraform destroy command.

When prompted to enter a region, you must enter the same value used when you added the environment to Sophos Cloud Optix.

If you no longer have the .tfstate file you can use the AWS CLI script to remove your environment.