Module 5: Resource Cleanup
To finish this experiment, you will go through the steps to clean up all the resources you created throughout this tutorial
In this module, you will go through the steps to clean up all the resources you created throughout this tutorial. You will delete your AWS Amplify app, an Amazon Cognito User Pool, an AWS Lambda function, an IAM role, a DynamoDB table, a REST API, and a CloudWatch Log. It is a best practice to delete resources you are no longer using to avoid unwanted charges.
Delete your app
Delete your Amplify app.
- In the AWS Amplify console, select the wildrydes-site app you created in Module 1.
- On the app homepage, choose Actions and select Delete app. Enter delete when prompted to confirm, then choose Delete.
Delete your Amazon Cognito user pool
If you used the provided AWS CloudFormation template to complete Module 2, simply delete the stack using the AWS CloudFormation console. Otherwise, delete the Amazon Cognito user pool you created in Module 2.
- In the Amazon Cognito console, select your WildRydes User pool name.
- Choose Delete user pool.
- Select the checkbox next to Deactivate deletion protection.
- Enter WildRydes to confirm deletion, and choose Delete.
Delete your serverless backend
Delete the AWS Lambda function, IAM role and Amazon DynamoDB table you created in Module 3.
AWS Lambda function
- In the AWS Lambda console on the Functions page, select the RequestUnicorn function you created in Module 3.
- From the Actions drop-down, choose Delete function.
- In the IAM console, select Roles from the left navigation pane.
- Enter WildRydesLambda into the filter box.
- Select the checkbox next to the role you created in Module 3, WildRydesLambda and choose Delete.
- To confirm deletion, enter WildRydesLambda into the text input field. Choose Delete.
Amazon DynamoDB table
- In the Amazon DynamoDB console, select Tables in the left navigation pane.
- Select the checkbox next to the Rides table you created in Module 3.
- Choose Delete.
- Select the checkbox next to Delete all CloudWatch alarms for Rides, enter confirm in the text input field, and choose Delete.
- The Status field on the Tables page will change to Deleting, and the table will disappear from the tables list when it has been successfully deleted.
Delete your REST API
Delete the REST API created in Module 4.
- In the Amazon API Gateway console, select the WildRydes API you created in Module 4.
- In the Actions dropdown, choose Delete.
- Choose Delete on the Delete API confirmation screen.
Delete your CloudWatch Log
AWS Lambda automatically creates a new log group per function in Amazon CloudWatch Logs and writes logs to it when your function is invoked. You should delete the log group for the RequestUnicorn function. Also, if you launched any CloudFormation stacks, there may be log groups associated with custom resources in those stacks that you should delete.
- From the Amazon CloudWatch console, expand Logs in the left navigation pane and select Log groups.
- Select the checkbox next to the /aws/lambda/RequestUnicorn log group. If you have several log groups in your account, you can enter /aws/lambda/RequestUnicorn into the Filter text box to locate the log group.
- Select Delete log group(s) from the Actions dropdown.
- Choose Delete when prompted to confirm.
- If you launched any CloudFormation templates to complete a module, repeat steps 2-4 for any log groups that begin with /aws/lambda/wildrydes-webapp.