This is an automated email from the ASF dual-hosted git repository.
donald pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/predictionio.git
The following commit(s) were added to refs/heads/develop by this push:
new 403a42c switch to DefaultAWSCredentialsProviderChain which also
includes ProfileCredentialsProvider, but 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 (#496)
403a42c is described below
commit 403a42c357e36bb7362d1e6abd0d67d7ba016e4a
Author: Chris Wewerka <[email protected]>
AuthorDate: Sun Dec 9 01:50:34 2018 +0100
switch to DefaultAWSCredentialsProviderChain which also includes
ProfileCredentialsProvider, but 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 (#496)
---
.../org/apache/predictionio/data/storage/s3/StorageClient.scala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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 d96b37d..6408f37 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))