AWS SDK for JavaScript
Developer Guide for SDK v2

Run the Lambda Function

This topic is part of a larger tutorial about using the AWS SDK for JavaScript with AWS Lambda functions. To start at the beginning of the tutorial, see Tutorial: Creating and Using Lambda Functions.

After you finish creating and configuring the following required resources, you're ready to run the application to execute the AWS Lambda function:

  • Amazon S3 bucket

  • Amazon Cognito identity pool

  • IAM execution role

  • Amazon DynamoDB table

  • Lambda function

To run the browser application

  1. Open a web browser.

  2. Point the browser at the URL for the Amazon S3 bucket that hosts the application.

    
          Slot machine web application running in a browser that invokes a Lambda
            function
  3. Choose or touch the handle on the right side of the slot machine. The wheels begin to spin as the browser script invokes the Lambda function to generate results for this turn.

    
          Web application running in a browser that invokes a Lambda function.
  4. Once the Lambda function returns the spin results to the browser script, the browser script sets the game display to show the images that the Lambda function selected.

  5. Choose or touch the handle again to start another spin.

Tutorial Clean Up

Ensure that you don't incur ongoing charges for the resources and services used in this tutorial by doing the following cleanup.

After you complete the application, delete these resources in their respective service consoles:

On this page: