This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d9aad5e96954bba2cf6297a7086f38d5c4e8811c
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Thu May 13 15:26:38 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the 
components - IAM Component
---
 .../main/java/org/apache/camel/component/aws2/iam/IAM2Component.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-aws/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Component.java
 
b/components/camel-aws/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Component.java
index c621af4..a13ca64 100644
--- 
a/components/camel-aws/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Component.java
+++ 
b/components/camel-aws/camel-aws2-iam/src/main/java/org/apache/camel/component/aws2/iam/IAM2Component.java
@@ -52,9 +52,9 @@ public class IAM2Component extends DefaultComponent {
         IAM2Configuration configuration = this.configuration != null ? 
this.configuration.copy() : new IAM2Configuration();
         IAM2Endpoint endpoint = new IAM2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        if (configuration.getIamClient() == null
+        if (!configuration.isUseDefaultCredentialsProvider() && 
configuration.getIamClient() == null
                 && (configuration.getAccessKey() == null || 
configuration.getSecretKey() == null)) {
-            throw new IllegalArgumentException("Amazon IAM client or accessKey 
and secretKey must be specified");
+            throw new IllegalArgumentException("seDefaultCredentialsProvider 
is set to false, Amazon IAM client or accessKey and secretKey must be 
specified");
         }
 
         return endpoint;

Reply via email to