Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用DefaultAWSCredentialsProviderChain()创建DynamoDbAsyncClient_Java_Amazon Web Services_Amazon Dynamodb - Fatal编程技术网

Java 使用DefaultAWSCredentialsProviderChain()创建DynamoDbAsyncClient

Java 使用DefaultAWSCredentialsProviderChain()创建DynamoDbAsyncClient,java,amazon-web-services,amazon-dynamodb,Java,Amazon Web Services,Amazon Dynamodb,我正在使用以下代码片段创建DynamoDbAsyncClient: @Bean public DynamoDbAsyncClient dynamoDbAsyncClient() throws URISyntaxException{ return DynamoDbAsyncClient.builder() .credentialsProvider(software.amazon.awssdk.auth.credentials.DefaultCredentialsPr

我正在使用以下代码片段创建DynamoDbAsyncClient:

@Bean
public DynamoDbAsyncClient dynamoDbAsyncClient() throws URISyntaxException{
    return DynamoDbAsyncClient.builder()
            .credentialsProvider(software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider.create())
            .region(Region.of(region))
            .overrideConfiguration(DynamoProperties.getOverrideConfiguration(dynamoProperties.getAsync()))
            .endpointOverride(new URI(amazonDynamoDBEndpoint))
            .build();
}
如何使用默认凭据提供程序链创建相同的客户端。如下所示:

 clientBuilder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(amazonDynamoDBEndpoint, region))
           .withCredentials(new DefaultAWSCredentialsProviderChain());
任何帮助都将不胜感激