Remove your AWS environment

You can remove your AWS environment from Sophos Cloud Optix.

To remove an AWS environment, use the same method used to add it. For example if you added an environment using the CloudFormation method, you should use AWS CloudFormation to remove it.

The methods are as follows:

  • AWS CloudFormation.
  • AWS CLI script.
  • Terraform.

A full Sophos Cloud Optix setup creates resources in your AWS environment to send logs to the service. These resources will be deleted using the methods described on this page. But these methods do not remove S3 buckets. You must manually remove them from your AWS environment afterward.

Using AWS CloudFormation

If you added an environment using AWS CloudFormation you must remove it with AWS CloudFormation.

Follow the instructions in Deleting a stack on the AWS CloudFormation console.

If necessary you must manually delete S3 buckets from your AWS environment.

Using an AWS CLI script

To remove an environment added with the ASW CLI script method, 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

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.