Clean-up Instructions
This page explains how to clean up resources and data from an InsuranceLake deployment. These instructions apply to all deployment methods (Quickstart, Quickstart with CI/CD, and Full Deployment).
Contents
- Clean-up Workflow-created Resources
- Clean-up ETL Stacks
- Clean-up Infrastructure Stacks
- Clean-up CDK Bootstrap (optional)
Clean-up Workflow-created Resources
- If you have not previously set the default AWS region for your session, you must set it now. - The default region for InsuranceLake is - us-east-2.- export AWS_DEFAULT_REGION=<replace with your region>
- Use the - etl_cleanup.pyscript to clear the S3 buckets, Data Catalog entries, logs, and DynamoDB tables:- resources/etl_cleanup.py --mode allbuckets- You can also manually empty all six InsuranceLake S3 buckets (cleanse, collect, consume, etl-scripts, glue-temp, access-logs) before cleaning up the stacks (as detailed below). - If you want to retain Data Catalog entries, logs, and S3 bucket contents, do not run the script above. Follow the instructions below to remove all stack-created resources except the S3 buckets (which will fail due to them containing objects). The buckets follow the defined retention policy in s3_bucket_zones_stack.py. 
Clean-up ETL Stacks
- Delete stacks using the command - cdk destroy --all. When you see the following text, enter y, and press enter/return.- Are you sure you want to delete: Test-InsuranceLakeEtlPipeline, Prod-InsuranceLakeEtlPipeline, Dev-InsuranceLakeEtlPipeline (y/n)?- This operation deletes the infrastructure pipeline stacks only in the central deployment account. 
- To delete stacks in development account, log onto the Dev account, go to CloudFormation console and delete the following stacks in the order listed: - For each environment below, be sure to delete the stacks in the order they are listed, so that stack dependencies do not prevent deletion. - Dev-InsuranceLakeEtlAthenaHelper
- Dev-InsuranceLakeEtlStepFunctions
- Dev-InsuranceLakeEtlGlue
- Dev-InsuranceLakeEtlDynamoDb
 
- To delete stacks in test account, log onto the Test account, go to CloudFormation console and delete the following stacks in the order listed: - Test-InsuranceLakeEtlAthenaHelper
- Test-InsuranceLakeEtlStepFunctions
- Test-InsuranceLakeEtlGlue
- Test-InsuranceLakeEtlDynamoDb
 
- To delete stacks in prod account, log onto the Prod account, go to CloudFormation console and delete the following stacks in the order listed: - Prod-InsuranceLakeEtlAthenaHelper
- Prod-InsuranceLakeEtlStepFunctions
- Prod-InsuranceLakeEtlGlue
- Prod-InsuranceLakeEtlDynamoDb
 
Clean-up Infrastructure Stacks
- Delete stacks using the command - cdk destroy --all.
- When you see the following text, enter y, and press enter: - Are you sure you want to delete: Test-InsuranceLakeInfrastructurePipeline, Prod-InsuranceLakeInfrastructurePipeline, Dev-InsuranceLakeInfrastructurePipeline (y/n)?- This operation deletes the ETL pipeline stacks only in the central deployment account. 
- To delete stacks in development account, log onto the Dev account, go to CloudFormation console and delete the following stacks: - Dev-InsuranceLakeInfrastructureVpc
- Dev-InsuranceLakeInfrastructureS3BucketZones
 
- To delete stacks in test account, log onto the Test account, go to CloudFormation console and delete the following stacks: - Test-InsuranceLakeInfrastructureVpc
- Test-InsuranceLakeInfrastructureS3BucketZones
 
- To delete stacks in prod account, log onto the Prod account, go to CloudFormation console and delete the following stacks: - Prod-InsuranceLakeInfrastructureVpc
- Prod-InsuranceLakeInfrastructureS3BucketZones
 
Clean-up CDK Bootstrap (optional)
If you are not using AWS CDK for other purposes, you can also delete the CDKToolkit stack in each target account.