Skip to content

Migration Infrastructure Teardown

Tanner Lewis edited this page Aug 7, 2024 · 18 revisions

After a migration is complete all resources should be removed except for the target cluster, and optionally you Cloudwatch Logs, and Replayer logs.

To remove all the CDK stack(s) which get created during a deployment you can execute a command similar to below within the CDK directory

# For demo context
cdk destroy "*" --c contextId=demo-deploy

Or to remove an individual stack from the deployment we can execute

# For demo context
cdk destroy migration-console --c contextId=demo-deploy

Note: The demo-deploy contextId has the retention policy for the OpenSearch Domain set to DESTROY, which will remove this resource and all its data when the stack is deleted. In order to retain the Domain on stack deletion the domainRemovalPolicy would need to be set to RETAIN.

Clone this wiki locally