You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/01/30 08:36:43 UTC
[camel] 04/15: Camel-AWS EC2 - Use Regions.valueOf in the verifier
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit fd5f1fee024dc871e6d600c158713a753b08382c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jan 30 08:59:28 2018 +0100
Camel-AWS EC2 - Use Regions.valueOf in the verifier
---
.../apache/camel/component/aws/ec2/EC2ComponentVerifierExtension.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2ComponentVerifierExtension.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2ComponentVerifierExtension.java
index 92ea951..0e82da3 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2ComponentVerifierExtension.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2ComponentVerifierExtension.java
@@ -23,6 +23,7 @@ import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.regions.Regions;
import com.amazonaws.services.ec2.AmazonEC2;
import com.amazonaws.services.ec2.AmazonEC2ClientBuilder;
@@ -70,7 +71,7 @@ public class EC2ComponentVerifierExtension extends DefaultComponentVerifierExten
EC2Configuration configuration = setProperties(new EC2Configuration(), parameters);
AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);
- AmazonEC2 client = AmazonEC2ClientBuilder.standard().withCredentials(credentialsProvider).withRegion(configuration.getRegion()).build();
+ AmazonEC2 client = AmazonEC2ClientBuilder.standard().withCredentials(credentialsProvider).withRegion(Regions.valueOf(configuration.getRegion())).build();
client.describeInstances();
} catch (SdkClientException e) {
ResultErrorBuilder errorBuilder = ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION, e.getMessage())
--
To stop receiving notification emails like this one, please contact
acosentino@apache.org.