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-kamelets.git

commit 76611ebb58aa1d8ec19f03e3558e6c42102ed978
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Wed Jul 27 13:28:31 2022 +0200

    Added AWS Eventbridge Sink Kamelet
---
 .../kamelets/aws-eventbridge-sink.kamelet.yaml     | 149 +++++++++++++++++++++
 1 file changed, 149 insertions(+)

diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/aws-eventbridge-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/aws-eventbridge-sink.kamelet.yaml
new file mode 100644
index 00000000..fb1ecf86
--- /dev/null
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/aws-eventbridge-sink.kamelet.yaml
@@ -0,0 +1,149 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: aws-eventbridge-sink
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-SNAPSHOT"
+    camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI1NiAyNTYiIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJJY29uaWZ5SWQtMTgyM2Y2NTU1NjktYWYxZGQ1LT
 [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+    camel.apache.org/kamelet.group: "AWS Eventbridge"
+  labels:
+    camel.apache.org/kamelet.type: "sink"
+spec:
+  definition:
+    title: "AWS Eventbridge Sink"
+    description: |-
+      Send events to an Amazon Eventbridge Eventbus.
+
+      The basic authentication method for the Eventbridge service is to 
specify an access key and a secret key. These parameters are optional because 
the Kamelet provides a default credentials provider.
+      
+      If you use the default credentials provider, the Eventbridge client 
loads the credentials through this provider and doesn't use the basic 
authentication method.
+
+      In the headers, you need to set the `resources-arn` / `ce-resources-arn` 
property to specify the ARN of resources related to the event.
+
+      In the headers, you need to set the `detail-type` / `ce-detail-type` 
property to specify the detail type related to the event.
+
+      In the headers, you need to set the `event-source` / `ce-event-source` 
property to specify the event source related to the event.
+
+      If you do not set the property in the header, the Kamelet uses the 
exchange ID for the file name.
+    required:
+      - eventbusNameOrArn
+      - region
+    type: object
+    properties:
+      eventbusNameOrArn:
+        title: Eventbus Name
+        description: The Eventbridge Eventbus name or Amazon Resource Name 
(ARN).
+        type: string
+      accessKey:
+        title: Access Key
+        description: The access key obtained from AWS.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      secretKey:
+        title: Secret Key
+        description: The secret key obtained from AWS.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:alm:descriptor:com.tectonic.ui:password
+        - urn:camel:group:credentials
+      region:
+        title: AWS Region
+        description: The AWS region to access.
+        type: string
+        example: eu-west-1
+        enum: ["af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", 
"ap-northeast-3", "ap-south-1", "ap-southeast-1", "ap-southeast-2", 
"ap-southeast-3", "ca-central-1", "eu-central-1", "eu-north-1", "eu-south-1", 
"eu-west-1", "eu-west-2", "eu-west-3", "fips-us-east-1", "fips-us-east-2", 
"fips-us-west-1", "fips-us-west-2", "me-south-1", "sa-east-1", "us-east-1", 
"us-east-2", "us-west-1", "us-west-2", "cn-north-1", "cn-northwest-1", 
"us-gov-east-1", "us-gov-west-1", "us-iso-east [...]
+      useDefaultCredentialsProvider:
+        title: Default Credentials Provider
+        description: If true, the Eventbridge client loads credentials through 
a default credentials provider. If false, it uses the basic authentication 
method (access key and secret key).
+        type: boolean
+        x-descriptors:
+        - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        default: false
+      uriEndpointOverride:
+        title: Overwrite Endpoint URI
+        description: The overriding endpoint URI. To use this option, you must 
also select the `overrideEndpoint` option.
+        type: string
+      overrideEndpoint:
+        title: Endpoint Overwrite
+        description: Select this option to override the endpoint URI. To use 
this option, you must also provide a URI for the `uriEndpointOverride` option.
+        type: boolean
+        x-descriptors:
+          - 'urn:alm:descriptor:com.tectonic.ui:checkbox'
+        default: false
+  dependencies:
+    - "camel:core"
+    - "camel:aws2-eventbridge"
+    - "camel:kamelet"
+  template:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - choice:
+          when:
+          - simple: "${header[resources-arn]}"
+            steps:
+            - set-header:
+                name: CamelAwsEventbridgeResourcesArn
+                simple: "${header[resources-arn]}"
+          - simple: "${header[ce-resources-arn]}"
+            steps:
+            - set-header:
+                name: CamelAwsEventbridgeResourcesArn
+                simple: "${header[ce-resources-arn]}"
+      - choice:
+          when:
+          - simple: "${header[detail-type]}"
+            steps:
+            - set-header:
+                name: CamelAwsEventbridgeDetailType
+                simple: "${header[detail-type]}"
+          - simple: "${header[ce-detail-type]}"
+            steps:
+            - set-header:
+                name: CamelAwsEventbridgeDetailType
+                simple: "${header[ce-detail-type]}"
+      - choice:
+          when:
+          - simple: "${header[event-source]}"
+            steps:
+            - set-header:
+                name: CamelAwsEventbridgeSource
+                simple: "${header[event-source]}"
+          - simple: "${header[ce-event-source]}"
+            steps:
+            - set-header:
+                name: CamelAwsEventbridgeSource
+                simple: "${header[ce-event-source]}"            
+      - to:
+          uri: "aws2-eventbridge:{{eventbusNameOrArn}}"
+          parameters:
+            secretKey: "{{?secretKey}}"
+            accessKey: "{{?accessKey}}"
+            region: "{{region}}"
+            useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}"
+            uriEndpointOverride: "{{?uriEndpointOverride}}"
+            overrideEndpoint: "{{overrideEndpoint}}"
+            operation: "putEvent"

Reply via email to