Hi,
I am using the AWS SQS java sdk to connect and retrieve data from the alerts API in RDP. Every hour I need to refresh the cloud credentials as per the user guide, so I end up creating a new SQS client object because I am using StaticCredentialsProvider to pass in the cloud credentials. I can't seem to find how to use a dynamic credentials provider instead of rebuilding the client every time. I was wondering if anyone else has come across this?
StaticCredentialsProvider staticCredentialsProvider = StaticCredentialsProvider.create
(new AwsSessionCredentials.Builder()
.accessKeyId(credentials.getAccessKeyId())
.secretAccessKey(credentials.getSecretKey())
.sessionToken(credentials.getSessionToken())
.build());
SqsClient sqsClient = SqsClient.builder()
.httpClient(sqsRestClient)
.region(region)
.credentialsProvider(staticCredentialsProvider)
.build();
Thanks.