Skip to content

Client builder seems to always load com.amazonaws.auth.DefaultAWSCredentialsProviderChain which is expensive #2211

Closed
@ocind

Description

@ocind

For AmazonDynamoDBClientBuilder the recommended way to initialize the client is
AmazonDynamoDBClientBuilder.standard().withCredentials(...).build()

As I read in various other issues (such as #1774), DefaultAWSCredentialsProviderChain is expensive to create and should be avoided. However, there is no way not to load DefaultAWSCredentialsProviderChain while using the AmazonDynamoDBClientBuilder.

There was AmazonDynamoDBClient(AWSCredentialsProvider awsCredentialsProvider) however it has already been deprecated. https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBClient.java#L283

Is there a way to initialize AmazonDynamoDBClient without loading DefaultAWSCredentialsProviderChain to minimize cold start time?

I noticed that the SDK team does not consider new improvements for V1 anymore and focusing on V2 SDK development instead. We really wanted to move to v2 sdk however the lack of DynamoDb high level client in v2 really hinders us from doing so. It has been 2 years since V2 SDK is considered GA without a high level client. Hopefully it could be completed soon!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions