[ https://issues.apache.org/jira/browse/PIO-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713826#comment-16713826 ]
ASF GitHub Bot commented on PIO-194: ------------------------------------ dszeto closed pull request #496: PIO-194: switch to DefaultAWSCredentialsProviderChain which also includes ProfileCredentialsProvider URL: https://github.com/apache/predictionio/pull/496 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/storage/s3/src/main/scala/org/apache/predictionio/data/storage/s3/StorageClient.scala b/storage/s3/src/main/scala/org/apache/predictionio/data/storage/s3/StorageClient.scala index d96b37de4..6408f3796 100644 --- a/storage/s3/src/main/scala/org/apache/predictionio/data/storage/s3/StorageClient.scala +++ b/storage/s3/src/main/scala/org/apache/predictionio/data/storage/s3/StorageClient.scala @@ -17,21 +17,21 @@ package org.apache.predictionio.data.storage.s3 +import com.amazonaws.auth.DefaultAWSCredentialsProviderChain import org.apache.predictionio.data.storage.BaseStorageClient import org.apache.predictionio.data.storage.StorageClientConfig - -import com.amazonaws.auth.profile.ProfileCredentialsProvider import com.amazonaws.client.builder.AwsClientBuilder import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.AmazonS3ClientBuilder - import grizzled.slf4j.Logging class StorageClient(val config: StorageClientConfig) extends BaseStorageClient with Logging { override val prefix = "S3" val client: AmazonS3 = { - val builder = AmazonS3ClientBuilder.standard().withCredentials(new ProfileCredentialsProvider()) + val builder = AmazonS3ClientBuilder + .standard() + .withCredentials(DefaultAWSCredentialsProviderChain.getInstance()) (config.properties.get("ENDPOINT"), config.properties.get("REGION")) match { case (Some(endpoint), Some(region)) => builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region)) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > S3 Model Data Storage should allow more flexible ways for specifying AWS > credentials > ------------------------------------------------------------------------------------ > > Key: PIO-194 > URL: https://issues.apache.org/jira/browse/PIO-194 > Project: PredictionIO > Issue Type: Improvement > Components: Core > Reporter: Chris Wewerka > Priority: Major > > S3 Storage for Model metadata storage in AWS S3 currently uses > ProfileCredentialsProvider with the default profile. Switching to > DefaultAWSCredentialsProviderChain which also includes > ProfileCredentialsProvider as one step to get credentials,is a more flexible > solution. > It also allows e.g. for AWS Instance Profile Roles and thus is more flexible > and does not force developers to include credentials on their PredictionIO > machines. > https://github.com/apache/predictionio/pull/496 -- This message was sent by Atlassian JIRA (v7.6.3#76005)