EasyManua.ls Logo

Amazon AWS SDK User Manual

Amazon AWS SDK
19 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #10 background imageLoading...
Page #10 background image
You can hard-code credentials by passing the credential information to the configuration object using
AWS.config.update():
AWS.config.update({accessKeyId: 'akid', secretAccessKey: 'secret'});
Setting the Region
The AWS SDK for Node.js doesn't select the region by default.You can choose a region similarly to
setting credentials by either loading from disk or using AWS.config.update():
AWS.config.update({region: 'us-west-1'});
Service-Specific Configuration
Occasionally, you might want to apply configuration only to one service. For instance, you want to use
multiple EC2 objects in different regions.You can do this by passing configuration data directly to the
service object constructor:
var ec2 = new AWS.EC2({region: 'ap-southeast-2', maxRetries: 15});
Note that the constructor takes all of the same configuration data as the AWS.config object described
above, including credential information.
Immutable Configuration Data
Global configuration changes apply to all requests for all newly created services. Any newly created
service will merge its local options on top of the global configuration data at the time of creation.This
means that any future updates to the global AWS.config object will not apply to existing service objects.
These services would have to be manually updated with the new configuration data, or recreated using
the following command (assuming an existing s3 service object):
s3 = new AWS.S3(s3.config);
Version 0.9.1-pre.2 : Preview
6
AWS SDK for Node.js Getting Started Guide
Setting the Region
Question and Answer IconNeed help?

Do you have a question about the Amazon AWS SDK and is the answer not in the manual?

Amazon AWS SDK Specifications

General IconGeneral
CategorySoftware Development Kit (SDK)
DeveloperAmazon Web Services (AWS)
LicenseApache License 2.0
PurposeTo enable developers to interact with AWS services from their applications.
Supported LanguagesJava, Python, JavaScript, .NET, Ruby, PHP, Go, C++
Supported AWS ServicesAll AWS services
Operating SystemsWindows, macOS, Linux
Latest VersionVaries by SDK and language. Refer to the official AWS documentation for the specific SDK.
RepositoryGitHub (for many SDKs)
DocumentationAvailable on the AWS website.
SDK FeaturesAPI abstraction, request signing, error handling, retry logic, data serialization, and support for various authentication methods.

Summary

AWS SDK Installation and Initial Usage

Installation

Install the AWS SDK for Node.js using the npm package manager.

Usage

Require the AWS SDK package in your Node.js application.

AWS Account and Credentials

Signing Up for an AWS Account

Steps to create an AWS account and obtain credentials.

Viewing Access Credentials

How to find your AWS access key ID and secret access key.

Configuration Guide

The Configuration Object

Explains how to configure the SDK globally or per service.

Setting AWS Credentials

Methods for providing SDK credentials (env variables, disk).

Setting the Region

Configuring the AWS region for SDK requests.

Service-Specific Configuration

Applying configuration settings to individual service objects.

Supported AWS Services

List of Services

Provides a comprehensive list of supported AWS services.

Constructing a Service Object

How to create service-specific objects for API calls.

Making AWS SDK Requests

Asynchronous Callbacks

Handling asynchronous operations using callback functions.

Request and Response Objects

Understanding the structure of request and response data.

Simplified Callback Method

Using a simplified callback signature for operations.

AWS Request Events

Registering callbacks for request lifecycle events (success, error).

Multiple Callbacks and Chaining

Chaining multiple callbacks for comprehensive request handling.

Examples and Use Cases

Amazon S3 Operations

Examples of listing buckets and creating objects in S3.

Amazon DynamoDB Operations

Example for listing tables in Amazon DynamoDB.

Related product manuals