Skip to content

Instantly share code, notes, and snippets.

@mand2
Created September 2, 2021 14:42
Show Gist options
  • Save mand2/a95dd54290f467838f76438fa323c17c to your computer and use it in GitHub Desktop.
Save mand2/a95dd54290f467838f76438fa323c17c to your computer and use it in GitHub Desktop.
fun createS3DirectoryClient(accessKeyId: String,
secretAccessKey: String,
region: String): TransferManager {
val awsCredentials = AWSStaticCredentialsProvider(BasicAWSCredentials(accessKeyId, secretAccessKey))
val s3Client:AmazonS3 = AmazonS3ClientBuilder.standard()
.withCredentials(awsCredentials)
.withRegion(Regions.fromName(region))
.build()
return TransferManagerBuilder.standard()
.withS3Client(s3Client)
.build()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment