Skip to content

Commit

Permalink
Support DefaultCredentialProvider in the AWS Kamelets - AWS CloudWatch
Browse files Browse the repository at this point in the history
  • Loading branch information
oscerd committed Jan 27, 2022
1 parent 21f2ba2 commit b871ef6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
21 changes: 17 additions & 4 deletions kamelets/aws-cloudwatch-sink.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -43,8 +50,6 @@ spec:
`metric-dimension-value` / `ce-metricdimensionvalue` for the dimension value.
required:
- cwNamespace
- accessKey
- secretKey
- region
type: object
properties:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -155,6 +167,7 @@ spec:
- to:
uri: "aws2-cw:{{cwNamespace}}"
parameters:
secretKey: "{{secretKey}}"
accessKey: "{{accessKey}}"
secretKey: "{{?secretKey}}"
accessKey: "{{?accessKey}}"
region: "{{region}}"
useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -43,8 +50,6 @@ spec:
`metric-dimension-value` / `ce-metricdimensionvalue` for the dimension value.
required:
- cwNamespace
- accessKey
- secretKey
- region
type: object
properties:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -155,6 +167,7 @@ spec:
- to:
uri: "aws2-cw:{{cwNamespace}}"
parameters:
secretKey: "{{secretKey}}"
accessKey: "{{accessKey}}"
secretKey: "{{?secretKey}}"
accessKey: "{{?accessKey}}"
region: "{{region}}"
useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"

0 comments on commit b871ef6

Please sign in to comment.