In the previous modules, you built a recommendation engine for your application. To build this, you used:

These tools provide flexible, high-scale solutions to many problems you face when building recommendation engines.

In the following steps, you clean up the resources you created in this lab.

Time to Complete Module: 5 Minutes


  • Step 1. Delete the AWS Lambda, Amazon API Gateway, and Amazon Cognito resources

    First, delete your application resources.

    In the scripts/ folder, there is a file called delete-resources.sh. This script deletes your Lambda function, your API Gateway REST API, your function’s IAM role, and your Amazon Cognito user pool.

    Execute this script with the following command in your terminal:

    bash scripts/delete-resources.sh

    You should see the following output in your terminal:

    Removing REST API
    Deleting IAM role
    Deleting Lambda function
    Deleting Amazon Cognito User Pool
  • Step 1. Delete Amazon Neptune database and security group

    Next, remove the Amazon Neptune database you created.

    1. Navigate to the Neptune console, and in the left pane, choose Databases.
    2. Select the recommendations Writer instance and choose Actions, Delete.
    3. In the confirmation dialog box, clear the check box for Create final snapshot, and select the I acknowledge check box.
    4. Type delete me and choose Delete.
    5. Select the recommendations Writer instance and in the Connectivity & security section, choose the security group.
    6. In the Security Groups details tab, choose Actions, then Delete Security Group.
      Note: If a warning appears that there are network interfaces using the security group, the Neptune database isn't fully deleted yet. Choose Cancel in the dialog box and wait a few minutes before trying to delete again.
    7. In the Delete Security Group confirmation box, choose Yes, Delete.
  • Step 3. Delete the networking resources

    To enable your Lambda function to access both the Neptune instance plus the Amazon Cognito API, you created some networking resources such as a private subnet, a NAT Gateway, route tables, and an Elastic IP address.

    Some of these resources -- like the NAT Gateway and Elastic IP address -- will cost money, so you will want to be sure to remove them. There is a file called remove-networking.sh in the scripts/ directory that will remove these resources.

    You can execute the script by running the following command in your terminal:

    bash scripts/remove-networking.sh

    You should see the following output in your terminal:

    Disassociating route table
    Deleting route table
    Deleting NAT Gateway
    Sleeping for EIP disassociation
    Releasing Elastic IP
    Networking resources deleted!
    
  • Step 4. Delete the AWS Cloud9 environment

    Finally, delete the AWS Cloud9 environment that you used in this lab:

    1. Navigate to the AWS Cloud9 console.
    2. Choose the User Recommendations environment and choose Delete.
    3. In dialog box, type Delete and choose Delete.