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

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


The following commit(s) were added to refs/heads/0.7.x by this push:
     new 634d43a  Support DefaultCredentialProvider in the AWS Kamelets - AWS 
CloudWatch
634d43a is described below

commit 634d43a5679bc5ae4276f7fc4cbb80a2718dabbb
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Thu Jan 27 06:56:03 2022 +0100

    Support DefaultCredentialProvider in the AWS Kamelets - AWS CloudWatch
---
 kamelets/aws-cloudwatch-sink.kamelet.yaml           | 21 +++++++++++++++++----
 .../kamelets/aws-cloudwatch-sink.kamelet.yaml       | 21 +++++++++++++++++----
 2 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/kamelets/aws-cloudwatch-sink.kamelet.yaml 
b/kamelets/aws-cloudwatch-sink.kamelet.yaml
index 101b33c..8a85898 100644
--- a/kamelets/aws-cloudwatch-sink.kamelet.yaml
+++ b/kamelets/aws-cloudwatch-sink.kamelet.yaml
@@ -33,6 +33,13 @@ spec:
     description: |-
       Send messages to AWS CloudWatch metrics.
 
+      Access Key/Secret Key are the basic method for authenticating to the AWS 
CloudWatch Service. These parameters are optional, because the Kamelet provide 
also the 'useDefaultCredentialsProvider'.
+      
+      When using a default Credentials Provider the CloudWatch 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:
+
+
       There are several properties you can set in the headers, such as:
 
       `metric-name` / `ce-metricname` for the metric name.
@@ -43,8 +50,6 @@ spec:
       `metric-dimension-value` / `ce-metricdimensionvalue` for the dimension 
value.
     required:
       - cwNamespace
-      - accessKey
-      - secretKey
       - region
     type: object
     properties:
@@ -73,6 +78,13 @@ spec:
         description: The AWS region to connect to.
         type: string
         example: eu-west-1
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: Set whether the CloudWatch 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-cw"
     - "camel:kamelet"
@@ -155,6 +167,7 @@ spec:
       - to:
           uri: "aws2-cw:{{cwNamespace}}"
           parameters:
-            secretKey: "{{secretKey}}"
-            accessKey: "{{accessKey}}"
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
             region: "{{region}}"
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/aws-cloudwatch-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/aws-cloudwatch-sink.kamelet.yaml
index 101b33c..8a85898 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/aws-cloudwatch-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/aws-cloudwatch-sink.kamelet.yaml
@@ -33,6 +33,13 @@ spec:
     description: |-
       Send messages to AWS CloudWatch metrics.
 
+      Access Key/Secret Key are the basic method for authenticating to the AWS 
CloudWatch Service. These parameters are optional, because the Kamelet provide 
also the 'useDefaultCredentialsProvider'.
+      
+      When using a default Credentials Provider the CloudWatch 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:
+
+
       There are several properties you can set in the headers, such as:
 
       `metric-name` / `ce-metricname` for the metric name.
@@ -43,8 +50,6 @@ spec:
       `metric-dimension-value` / `ce-metricdimensionvalue` for the dimension 
value.
     required:
       - cwNamespace
-      - accessKey
-      - secretKey
       - region
     type: object
     properties:
@@ -73,6 +78,13 @@ spec:
         description: The AWS region to connect to.
         type: string
         example: eu-west-1
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: Set whether the CloudWatch 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-cw"
     - "camel:kamelet"
@@ -155,6 +167,7 @@ spec:
       - to:
           uri: "aws2-cw:{{cwNamespace}}"
           parameters:
-            secretKey: "{{secretKey}}"
-            accessKey: "{{accessKey}}"
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
             region: "{{region}}"
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"

Reply via email to