Movatterモバイル変換


[0]ホーム

URL:


Create service client requests - AWS SDK for JavaScript
DocumentationAWS SDK for JavaScriptDeveloper Guide for SDK Version 3

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

Create service client requests

Making requests to AWS service clients is straightforward. Version 3 (V3) of the SDK for JavaScript enables you to send requests.

To send a request:
  1. Initialize a client object with the desired configuration, such as a specific AWS Region.

  2. (Optional) Create a request JSON object with the values for the request, such as the name of a specific Amazon S3 bucket. You can examine the parameters for the request by looking at the API Reference topic for the interface with the name associated with the client method. For example, if you use theAbcCommand client method, the request interface isAbcInput.

  3. Initialize a service command, optionally, with the request object as input.

  4. Callsend on the client with the command object as input.

For example, to list your Amazon DynamoDB tables inus-west-2, you can do it with async/await.

import{ DynamoDBClient, ListTablesCommand} from "@aws-sdk/client-dynamodb";(async function (){ const dbClient = new DynamoDBClient({ region: 'us-west-2' }); const command = new ListTablesCommand({}); try{ const results = await dbClient.send(command); console.log(results.TableNames.join('\n')); } catch (err){ console.error(err); }})();
Use a callback function
Handle service client responses

[8]
ページ先頭

©2009-2025 Movatter.jp