Skip to content

AwsCredentialsConfiguration

Karen Chen edited this page Oct 6, 2022 · 1 revision

AWS Credentials Provider Configuration

Applicable plugins: IamAuthenticationPlugin, AwsSecretsManagerPlugin

The IamAuthenticationPlugin and AwsSecretsManagerPlugin both require authentication via AWS credentials to provide the functionality they offer. In the plugin logic, the mechanism to locate your credentials is defined by passing in an AwsCredentialsProvider object to the applicable AWS SDK client. By default, an instance of DefaultCredentialsProvider will be passed, which locates your credentials using the default credential provider chain described in this doc.

If you would like to use a different AwsCredentialsProvider or would like to define your own mechanism for providing AWS credentials, you can do so using the methods defined in the AwsCredentialsManager class. To configure the plugins to use your own logic, you can call the AwsCredentialsManager.setCustomHandler method, passing in a lambda or AwsCredentialsProviderHandler that returns an AwsCredentialsProvider.

Sample code

AwsCredentialsManagerExample.java