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 2022/02/04 13:58:15 UTC

[camel-kamelets] 09/12: Support DefaultCredentialProvider in the AWS Kamelets - AWS SNS Fifo

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

acosentino pushed a commit to branch 735-cont-2
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit ab3ff01b1a802fa654842770c41afc18dce08446
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Feb 4 14:54:51 2022 +0100

    Support DefaultCredentialProvider in the AWS Kamelets - AWS SNS Fifo
---
 kamelets/aws-sns-fifo-sink.kamelet.yaml | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/kamelets/aws-sns-fifo-sink.kamelet.yaml b/kamelets/aws-sns-fifo-sink.kamelet.yaml
index 23862bd..c49d68b 100644
--- a/kamelets/aws-sns-fifo-sink.kamelet.yaml
+++ b/kamelets/aws-sns-fifo-sink.kamelet.yaml
@@ -31,15 +31,17 @@ spec:
   definition:
     title: AWS SNS FIFO Sink
     description: |- 
-      Send message to an AWS SNS FIFO Topic
+      Send message to an AWS SNS FIFO Topic.
+
+      Access Key/Secret Key are the basic method for authenticating to the AWS SNS Service. These parameters are optional, because the Kamelet provide also the 'useDefaultCredentialsProvider'.
+      
+      When using a default Credentials Provider the SNS client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet.
 
       The Kamelet expects the following headers to be set:
 
       - `subject` / `ce-subject`: the subject of the message
     required:
       - topicNameOrArn
-      - accessKey
-      - secretKey
       - region
     type: object
     properties:
@@ -82,6 +84,13 @@ spec:
         x-descriptors:
         - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
         default: false
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: Set whether the SNS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.
+        type: boolean
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        default: false
   dependencies:
   - "camel:aws2-sns"
   - "camel:core"
@@ -130,9 +139,10 @@ spec:
                 uri: "aws2-sns:{{topicNameOrArn}}"
                 parameters:
                   autoCreateTopic: "{{autoCreateTopic}}"
-                  accessKey: "{{accessKey}}"
-                  secretKey: "{{secretKey}}"
+                  accessKey: "{{?accessKey}}"
+                  secretKey: "{{?secretKey}}"
                   region: "{{region}}"
+                  useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
                   messageGroupIdStrategy: "usePropertyValue"
                   messageDeduplicationIdStrategy: "useContentBasedDeduplication"
           otherwise:
@@ -141,8 +151,9 @@ spec:
                 uri: "aws2-sns:{{topicNameOrArn}}"
                 parameters:
                   autoCreateTopic: "{{autoCreateTopic}}"
-                  accessKey: "{{accessKey}}"
-                  secretKey: "{{secretKey}}"
+                  accessKey: "{{?accessKey}}"
+                  secretKey: "{{?secretKey}}"
                   region: "{{region}}"
+                  useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
                   messageGroupIdStrategy: "usePropertyValue"
                   messageDeduplicationIdStrategy: "useExchangeId"