Cleaning up API Resources and Lambda Functions

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Understanding RESTful APIs
lock
Defining New API Gateway Resources
lock
Creating an AWS Lambda Function Backend
lock
Versioning and Aliasing the Lambda Function
lock
Configuring the API Gateway Backend
lock
Following Best Practices for Versions, Aliases, and Stages
lock
Creating API Keys and Usage Plans
lock
Enabling CORS on API Gateway Resources
lock
Enabling API Gateway Caching and Throttling
lock
Cleaning up API Resources and Lambda Functions
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

Introduction

As a final step, you will delete all the resources created in the Lab.

 

Instructions

1. Delete the following resources in the given order to avoid conflicts:

  • API Key (API Keys > Delete API Key)
  • API Stages (Stages > dev/prod > Delete Stage)
  • Usage Plan (Actions > Delete Usage Plan)
  • API Resources (Actions > Delete API)
  • Lambda Function (Actions > Delete function)

Please note that you won't be able to delete Usage Plans if at least one API Stage is bound to it. That's why you'll need to delete stages first.

Alternatively, you can just delete the API altogether with its stages. You will need to confirm the API name in order to delete every API resource, model, stage, stage variable, etc.

alt

By deleting the Lambda Function, you will also delete all the related versions and aliases.

Interestingly, you could also delete the Lambda Function first and the AWS Console will not complain, although API Gateway will not have a backend anymore and your API will return a 500 error (Internal Server Error).

 

Summary

Congratulations, you have created, configured, and destroyed your first Serverless API.

Validation checks
2Checks
Deleted the API Gateway Resources

Check that the API Gateway Resources have been deleted.

Amazon API Gateway
Deleted the Lambda Functions

Check that the Lambda functions have been deleted.

AWS Lambda