Created
July 4, 2020 11:52
-
-
Save bmccann36/4c63cb90940f77170150f06ec421e80b to your computer and use it in GitHub Desktop.
zeebe credentials sourcing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (accessKey == null) { | |
logger.info("Creating Lambda client without credentials the container will use task IAM role "); | |
Regions region = Regions.fromName(this.region); | |
AWSLambdaClientBuilder builder = AWSLambdaClientBuilder.standard() | |
.withRegion(region); | |
client = builder.build(); | |
} else { | |
logger.info("Creating Lambda client with provided access and secret key"); | |
Regions region = Regions.fromName(this.region); | |
BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secret); | |
AWSLambdaClientBuilder builder = AWSLambdaClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion(region); | |
client = builder.build(); | |
} | |
return client; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment