Create the Amazon resources - Amazon SDK for JavaScript
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

The Amazon SDK for JavaScript V3 API Reference Guide describes in detail all the API operations for the Amazon SDK for JavaScript version 3 (V3).

Starting October 1, 2022, Amazon SDK for JavaScript (v3) will end support for Internet Explorer 11 (IE 11). For details, see Announcing the end of support for Internet Explorer 11 in the Amazon SDK for JavaScript (v3).

Create the Amazon resources

This topic is part of a tutorial that demonstrates to to invoke Lambda functions using Amazon Step Functions. To start at the beginning of the tutorial, see Creating Amazon serverless workflows using Amazon SDK for JavaScript.

This tutorial requires the following resources.

  • An Amazon DynamoDB table named Case with a key named Id.

  • An IAM role named lambda-support used to invoke Lambda functions. This role has policies that enable it to invoke the Amazon DynamoDB and Amazon Simple Email Service services from a Lambda function.

  • An IAM role named workflow-support used to invoke the workflow.

  • An Amazon S3 bucket to host the Lambda functions.

You can create these resources manually, but we recommend provisioning these resources using the Amazon Cloud Development Kit (Amazon CDK) (Amazon CDK) as described in this tutorial.

Create the Amazon resources using the Amazon CloudFormation

Amazon CloudFormation enables you to create and provision Amazon infrastructure deployments predictably and repeatedly. For more information about Amazon CloudFormation, see the Amazon CloudFormation developer guide..

To create the Amazon CloudFormation stack:

  1. Install and configure the Amazon CLI following the instructions in the Amazon CLI User Guide.

  2. Create a file named setup.yaml in the root directory of your project folder, and copy the content here on GitHub into it.

    Note

    The Amazon CloudFormation template was generated using the Amazon CDK available here on GitHub. For more information about the Amazon CDK, see the Amazon Cloud Development Kit (Amazon CDK) Developer Guide.

  3. Run the following command from the command line, replacing STACK_NAME with a unique name for the stack.

    Important

    The stack name must be unique within an Amazon Region and Amazon account. You can specify up to 128 characters, and numbers and hyphens are allowed.

    aws cloudformation create-stack --stack-name STACK_NAME --template-body file://setup.yaml --capabilities CAPABILITY_IAM

    For more information on the create-stack command parameters, see the Amazon CLI Command Reference guide, and the Amazon CloudFormation User Guide.

Create the Amazon resources using the Amazon Web Services Management Console;

To create resources for the app in the console, follow the instructions in the Amazon CloudFormation User Guide. Use the template provided create a file named setup.yaml, and copy the content here on GitHub.

Important

The stack name must be unique within an Amazon Region and Amazon account. You can specify up to 128 characters, and numbers and hyphens are allowed.

View a list of the resources in the console by opening the stack on the Amazon CloudFormation dashboard, and choosing the Resources tab. You require these for the tutorial.