Skip to content

Commit 295ee62

Browse files
committed
Removing env var credentials provider.
SnapStart uses a different credentials provider so when it is hardcoded like this, the default will fail.
1 parent c82de63 commit 295ee62

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

powertools-idempotency/src/main/java/software/amazon/lambda/powertools/idempotency/persistence/DynamoDBPersistenceStore.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ private DynamoDBPersistenceStore(String tableName,
8686
String idempotencyDisabledEnv = System.getenv().get(Constants.IDEMPOTENCY_DISABLED_ENV);
8787
if (idempotencyDisabledEnv == null || idempotencyDisabledEnv.equalsIgnoreCase("false")) {
8888
DynamoDbClientBuilder ddbBuilder = DynamoDbClient.builder()
89-
.credentialsProvider(EnvironmentVariableCredentialsProvider.create())
9089
.httpClient(UrlConnectionHttpClient.builder().build())
9190
.region(Region.of(System.getenv(AWS_REGION_ENV)));
9291
this.dynamoDbClient = ddbBuilder.build();
@@ -238,6 +237,10 @@ private DataRecord itemToRecord(Map<String, AttributeValue> item) {
238237
item.get(this.inProgressExpiryAttr) != null ? OptionalLong.of(Long.parseLong(item.get(this.inProgressExpiryAttr).n())) : OptionalLong.empty());
239238
}
240239

240+
public DynamoDbClient getDynamoDbClient() {
241+
return dynamoDbClient;
242+
}
243+
241244
public static Builder builder() {
242245
return new Builder();
243246
}

0 commit comments

Comments
 (0)