FINERACT-1724: Fix for closing the AWS credentials provider unnecessarily upon startup

This commit is contained in:
Arnold Galovics
2023-08-30 11:13:14 +02:00
committed by Adam Saghy
parent 63d6cb38ab
commit 435f75b6c0
@@ -34,8 +34,10 @@ public class AmazonS3ConfigCondition extends PropertiesCondition {
}
private boolean isAwsCredentialValid() {
try (var defaultCredentialsProvider = DefaultCredentialsProvider.create()) {
defaultCredentialsProvider.resolveCredentials();
try {
// The credentials provider is intentionally not closed here since Spring will close it at the
// context closure event
DefaultCredentialsProvider.create().resolveCredentials();
DefaultAwsRegionProviderChain.builder().build().getRegion();
return true;
} catch (Exception e) {