@Bean public AmazonDynamoDBAsync getDynamoDBClient() { return AmazonDynamoDBAsyncClientBuilder.standard() .withCredentials(new ProfileCredentialsProvider(CREDENTIALS_PROVIDER)) .withRegion(Regions.AP_SOUTHEAST_2) .build(); }
@PostConstruct public void connect(){ BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(accessKey, secretKey); AmazonDynamoDB client = AmazonDynamoDBAsyncClientBuilder .standard() .withRegion(region) .withCredentials(new AWSStaticCredentialsProvider(basicAWSCredentials)) .build(); dynamoDB = new DynamoDB(client); mapper = new DynamoDBMapper(client); }