Clean up resources

After completing this exercise, we need to clean up all resources to avoid incurring unnecessary charges.

Delete the Distribution

Go to the distribution list, select the distribution we created, and click Delete.

8-clean-up-resources

Next, in the API Gateway APIs list, select imga-api and click Delete.

8-clean-up-resources

Go to VPC links, select the VPC link we created, and click Delete.

8-clean-up-resources

Delete Network Load Balancer and Target Group

In the EC2 interface, scroll down to Load Balancer, select the NLB we created earlier

  • Click Actions.
  • Select Delete load balacner.

8-clean-up-resources

Next, in the target groups list, select prod-ec2

  • Click Actions.
  • Select Delete.

8-clean-up-resources

Delete EC2 Instances

Also, in the EC2 interface, go to the EC2 instance list. We will terminate both EC2 instances we created.

8-clean-up-resources 8-clean-up-resources

Delete NAT Gateway and Elastic IP

In the NAT Gateway section, select the NAT Gateway we created

  • Click Actions.
  • Select Delete NAT gateway.

8-clean-up-resources

Once the NAT Gateway is fully deleted, go to the Elastic IP list, select the Elastic IP created with the NAT Gateway

  • Click Actions.
  • Select Release Elastic IP address.

8-clean-up-resources

The VPC Link created an ENI, which uses an Elastic IP. However, since we have deleted the VPC Link, the Elastic IP has also been deleted.

Delete VPC Peering and VPC Resources

In the VPC interface’s peering connection list, select the peering connection we created at the beginning.

  • Click Actions.
  • Select Delete peering connection.

8-clean-up-resources

Next, in the VPC list, delete the two VPCs we created initially.

  • Click Actions.
  • Select Delete VPC.

8-clean-up-resources 8-clean-up-resources

Delete Repository on ECR

In the ECR interface, go to the repository we created and delete the Docker image first. Select the image and click Delete.

8-clean-up-resources

Now, we can delete the repository.

8-clean-up-resources

Delete S3 Buckets

In the S3 Bucket list, we will delete the Buckets we created. First, the S3 Bucket for the website.

  • Select Empty.

8-clean-up-resources

Confirm that you want to delete the objects in the bucket.

8-clean-up-resources

Select the bucket again and click Delete.

8-clean-up-resources

Confirm the deletion.

8-clean-up-resources

Similarly, for the remaining bucket, follow the same steps to delete it. We have now cleaned up all the resources from this workshop.