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

  1. Use the etl_cleanup.py script to clear the S3 buckets, Data Catalog entries, logs, and DynamoDB tables:
    AWS_DEFAULT_REGION=us-east-2 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

  1. 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.

  2. 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.

    1. Dev-InsuranceLakeEtlAthenaHelper
    2. Dev-InsuranceLakeEtlStepFunctions
    3. Dev-InsuranceLakeEtlGlue
    4. Dev-InsuranceLakeEtlDynamoDb
  3. To delete stacks in test account, log onto the Test account, go to CloudFormation console and delete the following stacks in the order listed:

    1. Test-InsuranceLakeEtlAthenaHelper
    2. Test-InsuranceLakeEtlStepFunctions
    3. Test-InsuranceLakeEtlGlue
    4. Test-InsuranceLakeEtlDynamoDb
  4. To delete stacks in prod account, log onto the Prod account, go to CloudFormation console and delete the following stacks in the order listed:

    1. Prod-InsuranceLakeEtlAthenaHelper
    2. Prod-InsuranceLakeEtlStepFunctions
    3. Prod-InsuranceLakeEtlGlue
    4. Prod-InsuranceLakeEtlDynamoDb

Clean-up Infrastructure Stacks

  1. Delete stacks using the command cdk destroy --all.

  2. 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.

  3. To delete stacks in development account, log onto the Dev account, go to CloudFormation console and delete the following stacks:

    1. Dev-InsuranceLakeInfrastructureVpc
    2. Dev-InsuranceLakeInfrastructureS3BucketZones
  4. To delete stacks in test account, log onto the Test account, go to CloudFormation console and delete the following stacks:

    1. Test-InsuranceLakeInfrastructureVpc
    2. Test-InsuranceLakeInfrastructureS3BucketZones
  5. To delete stacks in prod account, log onto the Prod account, go to CloudFormation console and delete the following stacks:

    1. Prod-InsuranceLakeInfrastructureVpc
    2. 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.


Back to top

Copyright Amazon.com and its affiliates; all rights reserved. This file is Amazon Web Services Content and may not be duplicated or distributed without permission.

Page last modified: Sep 26 2024.