Clean up resources

Clean Up Resources

ℹ️ Information: Properly cleaning up AWS resources after completing your lab is essential to avoid unexpected charges on your AWS account. Follow these steps to ensure all resources are terminated and deleted.

Terminate EC2 Instances

  1. Access the EC2 dashboard
  2. Navigate to Instances
  3. Select the instances associated with the lab
  4. Click on Instance state
  5. Select Terminate instance

Clean Up Resource

Delete Amazon Machine Images (AMIs)

  1. Access the EC2 dashboard
  2. Go to AMIs in the left navigation pane
  3. Select the AMI you created during the lab
  4. Click on Actions
  5. Choose Deregister AMI

Clean Up Resource

Delete EBS Snapshots

  1. Access the EC2 dashboard
  2. Navigate to Snapshots in the left navigation pane
  3. Select the snapshots associated with the lab
  4. Click on Actions
  5. Choose Delete snapshot

Clean Up Resource

Delete Security Groups

  1. Access the EC2 dashboard
  2. Go to Security Groups in the left navigation pane
  3. Select the security groups associated with the lab
  4. Click on Actions
  5. Select Delete security group

⚠️ Warning: Ensure that the security group is not attached to any running instances before attempting to delete it.

Clean Up Resource

Remove Key Pairs

  1. Access the EC2 dashboard
  2. Navigate to Key Pairs in the left navigation pane
  3. Select the key pair used for the lab
  4. Click on Actions
  5. Select Delete

Clean Up Resource

Delete VPC Resources

  1. Access the VPC dashboard
  2. Navigate to Your VPCs in the left navigation pane
  3. Select the VPC associated with the lab
  4. Click on Actions
  5. Select Delete VPC

💡 Pro Tip: Using the “Delete VPC” option will automatically delete associated subnets, route tables, internet gateways, and NAT gateways attached to the VPC.

Clean Up Resource

Delete IAM User Groups, User, Roles, Policies

Access the IAM console:

  1. Delete User Groups Clean Up Resource

  2. Delete User Clean Up Resource

  3. Delete Policies Clean Up Resource

  4. Delete Roles Clean Up Resource

🔒 Security Note: Regularly review and clean up resources that are no longer needed to maintain the principle of least privilege in your AWS account.