Cleaning up API Resources and Lambda Functions

Lab Steps

Logging in to the Amazon Web Services Console
Understanding RESTful APIs
Defining New API Gateway Resources
Creating an AWS Lambda Function Backend
Versioning and Aliasing the Lambda Function
Configuring the API Gateway Backend
Following Best Practices for Versions, Aliases, and Stages
Creating API Keys and Usage Plans
Enabling CORS on API Gateway Resources
Enabling API Gateway Caching and Throttling
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.

You can pause this lab for
(up to) 1h


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



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.


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).



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

Validation checks
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