You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
* updates to dynamodb_basics.js scenario
Co-authored-by: ford prior <[email protected]>
Co-authored-by: Irene Smith <[email protected]>
These are examples for the AWS SDK for JavaScript version 3 (v3) public documentation.
2
+
# AWS SDK for JavaScript (v3) code examples
3
+
## Overview
4
+
The code examples in this topic show you how to use the AWS SDK for JavaScript (v3) with AWS.
4
5
5
-
## Prerequisites
6
-
To build and run these examples, you need to:
6
+
The AWS SDK for JavaScript (v3) provides a JavaScript API for AWS infrastructure services. Using the SDK, you can build applications on top of Amazon S3, Amazon EC2, Amazon DynamoDB, and more.
7
7
8
-
* Set up the project environment to run these TypeScript examples with Node.js, and install the required AWS SDK for JavaScript and third-party modules. Follow the instructions in the README.md in the folder with the examples you're running; for example, [instructions for Amazon S3 examples](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/javascriptv3/example_code/s3/README.md).
9
-
*Create a shared configurations file with your user credentials. See the [AWS SDK for JavaScript v3 Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html) for more information.
8
+
## Types of code examples
9
+
***Single-service actions** - Code examples that show you how to call individual service functions.
10
10
11
-
## Running the examples
12
-
Examples are written for either execution in a browser script or in Node.js, usually depending on the use case for each. The two scenarios typically differ in how you supply credentials to the code. For information on the differences, see the [AWS SDK for JavaScript v3 Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials.html).
11
+
***Single-service scenarios** - Code examples that show you how to accomplish a specific task by calling multiple functions within the same service.
13
12
14
-
The Node.js examples are all run from the command line.
13
+
***Cross-service examples** - Sample applications that work across multiple AWS services.
15
14
16
-
##Unit tests
17
-
[Unit tests](./tests)are provided for many examples, using the [Jest](https://jestjs.io/) framework.
15
+
### Find code examples
16
+
Single-service actions and scenarios are organized by AWS service in this folder. A README in each folder lists and describes how to run the examples.
18
17
19
-
To run tests, navigate to the **tests**folder.
18
+
Cross-service examples are located in the [*cross-services folder*](./cross-services). A README in each folder describes how to run the example.
20
19
21
-
For example, to run tests on the S3 folder, enter the following sequence of commands at the command prompt:
20
+
## ⚠️ Important
21
+
* Running this code might result in charges to your AWS account.
22
+
* Running the tests might result in charges to your AWS account.
23
+
* We recommend that you grant your code the least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
24
+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
22
25
26
+
27
+
### Prerequisites
28
+
* Latest stable version of Node.js.
29
+
* A shared configuration file with your user credentials. For more information, see the [AWS SDK for JavaScript (v3) Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html).
30
+
31
+
## Tests
32
+
**Note**: Running the tests might result in charges to your AWS account.
33
+
34
+
1. Where tests are provided, navigate to the 'tests' folder located in the root of the service folder.
35
+
36
+
**Note**: In some cases scenarios and cross-service examples have their own test folder, so navigate to that instead.
37
+
38
+
2. Run the following:
23
39
```
24
-
npm install node -g
25
-
cd javascriptv3/example_code/s3/tests
40
+
cd javascriptv3/example_code/[service folder name]
26
41
npm install
27
42
npm test
28
43
```
29
-
## Resources
30
-
*[AWS SDK for JavaScript v3](https://github.com/aws/aws-sdk-js-v3)
31
-
*[AWS SDK for JavaScript v3 Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/)
32
-
*[AWS SDK for JavaScript v3 API Reference](http://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html)
33
44
34
-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
-
SPDX-License-Identifier: Apache-2.0
45
+
## Additional resources
46
+
*[AWS SDK for JavaScript (v3)](https://github.com/aws/aws-sdk-js-v3)
47
+
*[AWS SDK for JavaScript (v3) Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/)
48
+
*[AWS SDK for JavaScript (v3) API Reference](http://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html)
49
+
50
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
# Amazon DynamoDB code examples for AWS SDK for JavaScript (v3)
2
2
The code examples in this directory demonstrate how to work with Amazon DynamoDB using the AWS SDK for JavaScript version 3 (v3).
3
3
4
-
Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It's a fully managed, multiregion, multimaster, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications.
4
+
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. You can use Amazon DynamoDB to create a database table that can store and retrieve any amount of data, and serve any level of request traffic. Amazon DynamoDB automatically spreads the data and traffic for the table over a sufficient number of servers to handle the request capacity specified by the customer and the amount of data stored, while maintaining consistent and fast performance.
5
+
###Table of contents
6
+
-[Important information](#-important-information)
7
+
-[Code examples](#code-examples)
8
+
-[Single actions](#single-actions)
9
+
-[Scenarios](#scenarios)
10
+
-[Run the examples](#run-the-examples)
11
+
-[Prerequisites](#prerequisites)
12
+
-[Steps](#steps)
13
+
-[Unit tests](#unit-tests)
14
+
-[Additional resources](#-A)
5
15
6
-
## Code examples
7
-
This is a workspace where you can find the following AWS SDK for JavaScript version 3 (v3) Amazon DynamoDB examples:
16
+
## ⚠️ Important information
17
+
* Running the tests might result in charges to your AWS account.
18
+
* We recommend that you grant your code the least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
19
+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
// Before you run this example, download 'movies.json' from https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Js.02.html,
128
-
// and put it in the same folder as the example.
129
130
// Get the movie data parse to convert into a JSON object.
0 commit comments