To delete resources deployed through the AWS Cloud Development Kit (CDK), you need to use the cdk destroy command in your CDK project. Here are the basic steps to accomplish this:
cd
command to move to the directory containing your CDK project.cd path/to/your/cdk/project
cdk destroy
command to delete the resources. This command will list all the resources to be deleted and ask for your confirmation before proceeding.cdk destroy
Confirm Resource Deletion: When prompted, you need to confirm that you want to delete the resources. This usually requires entering “y” or “yes”.
Wait for the Process to Complete: The AWS CDK will proceed to delete the resources. This process can take a few minutes depending on the number and type of resources being deleted.
Note that using cdk destroy will delete all the resources managed by the CDK stack you are working with. Make sure you no longer need these resources before proceeding with the deletion.