Skip to content

Legacy: Remove your AWS environment

You can remove your AWS environment from Sophos Cloud Optix.

Warning

You must only use this help section if you opened your Sophos Cloud Optix account before November 17, 2020. If you opened your account after that date, you must use the instructions under Add your AWS environment.

To remove an AWS environment, use the same method you 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.

More resources

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 "http://avidcore.s3-us-west-2.amazonaws.com/undo-add-account.sh" -o undo-add-account.sh

  2. Run the script using the command:

    bash undo-add-account.sh

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.