In this quick lesson we're going to clear out the SQS Queue and SNS Topic that was created for us when we created a CDK app with cdk init
in order for us to be able to start building our app from scratch.
Instructor: [0:00] Now is the time to clean. Our stack currently contains an SQS::Queue and also an SNS::Topic. Both of those are not things that we are going to need to build our app, so let me go over here and delete all of that. We are both going to delete the Queue and also the Topic as well as to remove all those unused imports.
[0:16] If I save that, right now our todo app stack is completely empty. Let's see what's going to happen if I deploy that. Let me run cdk diff in order to compare the changes between the currently deployed stack and the stack that we are about to deploy.
[0:28] Here in the Resources section, we can see that we are about to delete all those resources because this is exactly what we want. We want to start from scratch. Right now, if I run cdk deploy it's going to deploy this empty stack effectively deleting everything that was deployed before.
[0:42] That's the thing with CDK. You always get deployed exactly the things that you asked for and the things that are no longer needed will get deleted. You always have a consistent state of your infrastructure because this stack accurately reflects what exactly is going to be deployed to AWS Cloud once you run cdk deploy.
[0:59] Our empty stack has been deployed. Let's take a look inside of AWS Console to see exactly what was deployed. If I refresh that section over here, we can see that currently we barely have any resources. The only thing that remains is the internal CDKMetadata.
[1:12] We can also take a look inside of Events section over here to see that we were deleting all those resources from AWS. Right now, we are more than ready to start building our app from scratch.