Cleanup#
We've now got to take everything down, destroying it, because we don't need it and some resoufces, like EC2 Instances, cost money you don't need to spend right now.
EC2#
First, delete the EC2 Instance we created earlier:
- Make sure the correct instance has been selected here
- And then use the "Terminate instance" option under "Instance state"
AMI#
We can also clear away our AMI now too. This is under "Images" in the EC2 Console:
Warning
You can also select the option, and click the link, to delete any snapshots taken to produce this AMI, but only after you've degistered the AMI from your account. Make sure you do this. Snapahot may incur costs for you.
- Make sure to select the correct AMI
- And use the "Deregister AMI" option under "Actions"
Networking#
Now we clear away the networking stack. Luckily, we can do everything in one go. All you need to do is delete the VPC. Everything below the VPC will be deleted for you. Head over to the VPC section of the AWS Console, select the our-learning-vpc
VPC that we created, and in the "Actions" drop-down menu, select "Delete VPC":
On the following prompt that pops up, you can see some very interesting details:
- We can see the VPC ID and name - double check these always
- We can see exactly what will be deleted alongside the VPC
- And we have to confirm the process by typing
delete
into this field
What's interesting here is all the things that also get deleted - the subnets, IGW, etc. Essentially everything that depend on the VPC. AWS knows all the other resources cannot exist without the VPC you're trying to delete, so it deletes them too.
Type delete
and press "Delete" to confirm.
IAM#
And finally we need to clear away the IAM resources we created to make all of this possible. So let's delete our cloud-admin
IAM User, but you can keep the iam-admin
in place for future use.
Navigate to the IAM console, select "Users" and then click on cloud-admin
:
Finalise this by click "Yes, delete".
And you're done.