Creates the following AWS resources for Amazon DynamoDB item tracker sample applications:
- A DynamoDB table that has a string partition key named
iditem
.
- Running this code might result in charges to your AWS account.
- This code is not tested in every AWS Region. For more information, see AWS Regional Services.
You can use the AWS Cloud Development Kit (AWS CDK) or the AWS Command Line Interface (AWS CLI) to deploy and destroy the resources for this example.
To deploy with the AWS CDK, you must install Node.js and the AWS CDK.
This example was built and tested with AWS CDK 2.33.0.
Deploy AWS resources by running the following at a command prompt in this README's folder:
npm install
cdk deploy
The stack takes a few minutes to deploy. When it completes, it prints output like the following:
Outputs:
doc-example-work-item-tracker-stack.TableName = doc-example-work-item-tracker
To deploy with the AWS CLI, you must first install the AWS CLI.
-
Deploy AWS resources by running the following at a command prompt in this README's folder:
aws cloudformation create-stack --template-body file://setup.yaml --stack-name YOUR_STACK_NAME
Note: The stack name must be unique within an AWS Region and AWS account. You can specify up to 128 characters, and numbers and hyphens are allowed.
-
The stack takes a few minutes to deploy. You can check status by running the following:
aws cloudformation describe-stacks --stack-name YOUR_STACK_NAME
When the stack is ready, it shows
StackStatus
ofCREATE_COMPLETE
. -
You can get the outputs from the stack by running the following:
aws cloudformation describe-stacks --stack-name STACK_NAME --query Stacks[0].Outputs --output text
This results in output like the following:
TableName = doc-example-work-item-tracker
You can use the AWS CDK to destroy the resources by running the following:
cdk destroy
You can use the AWS CLI to destroy the resources by running the following:
aws cloudformation delete-stack --stack-name YOUR_STACK_NAME
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0