Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Locking API Versions - AWS SDK for JavaScript

We announced the upcoming end-of-support for AWS SDK for JavaScript v2. We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

We announced the upcoming end-of-support for AWS SDK for JavaScript v2. We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Locking API Versions

AWS services have API version numbers to keep track of API compatibility. API versions in AWS services are identified by a YYYY-mm-dd formatted date string. For example, the current API version for Amazon S3 is 2006-03-01.

We recommend locking the API version for a service if you rely on it in production code. This can isolate your applications from service changes resulting from updates to the SDK. If you don't specify an API version when creating service objects, the SDK uses the latest API version by default. This could cause your application to reference an updated API with changes that negatively impact your application.

To lock the API version that you use for a service, pass the apiVersion parameter when constructing the service object. In the following example, a newly created AWS.DynamoDB service object is locked to the 2011-12-05 API version:

var dynamodb = new AWS.DynamoDB({apiVersion: '2011-12-05'});

You can globally configure a set of service API versions by specifying the apiVersions parameter in AWS.Config. For example, to set specific versions of the DynamoDB and Amazon EC2 APIs along with the current Amazon Redshift API, set apiVersions as follows:

AWS.config.apiVersions = { dynamodb: '2011-12-05', ec2: '2013-02-01', redshift: 'latest' };

Getting API Versions

To get the API version for a service, see the Locking the API Version section on the service's reference page, such as https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html for Amazon S3.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.