The Amazon SDK for JavaScript V3 API
Reference Guide
Create the Amazon resources
This topic is part of a tutorial that create an Amazon application that sends and retrieves messages by using the Amazon SDK for JavaScript and Amazon Simple Queue Service (Amazon SQS). To start at the beginning of the tutorial, see Creating an example messaging application.
This tutorial requires the following resources.
-
An unautenticated IAM role with permissions for Amazon SQS.
-
A FIFO Amazon SQS Queue named Message.fifo - for information about creating a queue, see Creating an Amazon SQS queue
.
You can create this resources manually, but we recommend provisioning these resources using the Amazon CloudFormation (Amazon CloudFormation) as described in this tutorial.
Note
The Amazon CloudFormation is a software development framework that enables you to define cloud application resources. For more information, see the Amazon CloudFormation User Guide.
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 using the Amazon CLI:
Install and configure the Amazon CLI following the instructions in the Amazon CLI User Guide
. Create a file named
setup.yaml
in the root directory of your project folder, and copy the content here on GitHubinto 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. 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 . To view the resources created, open Amazon CloudFormation in the Amazon management console, choose the stack, and select the Resources tab.