Cleaning up API Resources and Lambda Functions
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.
Check that the API Gateway Resources have been deleted.
Check that the Lambda functions have been deleted.