|
| 1 | +# --------------------------------------------------------------------------- |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# --------------------------------------------------------------------------- |
| 17 | + |
| 18 | +apiVersion: camel.apache.org/v1 |
| 19 | +kind: Kamelet |
| 20 | +metadata: |
| 21 | + name: aws-eventbridge-sink |
| 22 | + annotations: |
| 23 | + camel.apache.org/kamelet.support.level: "Stable" |
| 24 | + camel.apache.org/catalog.version: "4.14.0" |
| 25 | + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI1NiAyNTYiIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJJY29uaWZ5SWQtMTgyM2Y2NTU1NjktYWYxZGQ1LTI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zYzAgMTAuNDI2IDguNDMzIDE4LjkwOSAxOC44IDE4LjkwOWMxLjkzMiAwIDMuOC0uMjk4IDUuNTU2LS44NDVMMjA3LjU0NSAxMjhsLTE1Ljg5MiAyNy42NzRsNS41MTIgMy4ybDE2LjgwOC0yOS4yNzRhMy4yMSAzLjIxIDAgMCAwIDAtMy4yWm0tMTQ2LjA0IDUwLjM5Yy02Ljg2IDAtMTIuNDQyLTUuNjEyLTEyLjQ0Mi0xMi41MDhjMC02LjkgNS41ODEtMTIuNTEgMTIuNDQyLTEyLjUxYzYuODU3IDAgMTIuNDM5IDUuNjEgMTIuNDM5IDEyLjUxYzAgNi44OTYtNS41ODIgMTIuNTA4LTEyLjQ0IDEyLjUwOFptMTAuMzkzIDMuMjM2YzUuMDYyLTMuMzkyIDguNDEtOS4xODEgOC40MS0xNS43NDRjMC0xMC40MjYtOC40MzYtMTguOTEtMTguODAzLTE4LjkxYy0zLjAwNCAwLTUuODMzLjczLTguMzUzIDEuOTk0TDQ4LjQ1OCAxMjhsMTguNDI4LTMyLjA5M2wtNS41MTUtMy4yTDQyLjAyNyAxMjYuNGEzLjIxIDMuMjEgMCAwIDAgMCAzLjJsMTIuMzg4IDIxLjU2OGMtMy4yNjggMy40MDUtNS4yODkgOC4wMjItNS4yODkgMTMuMTE0YzAgMTAuNDI1IDguNDM2IDE4LjkwOCAxOC44MDcgMTguOTA4YzEuNTYyIDAgMy4wNzQtLjIxNCA0LjUyOC0uNTc5bDEwLjE1IDE3LjY4Yy41Ny45ODkgMS42MiAxLjYgMi43NTcgMS42aDM5LjQ1MXYtNi40SDg3LjIwNGwtOC44NzgtMTUuNDY1WiIvPjwvc3ZnPg==" |
| 26 | + camel.apache.org/provider: "Apache Software Foundation" |
| 27 | + camel.apache.org/kamelet.group: "AWS Eventbridge" |
| 28 | + camel.apache.org/kamelet.namespace: "AWS" |
| 29 | + labels: |
| 30 | + camel.apache.org/kamelet.type: "sink" |
| 31 | +spec: |
| 32 | + definition: |
| 33 | + title: "AWS Eventbridge Sink" |
| 34 | + description: Send events to an Amazon Eventbridge Eventbus. |
| 35 | + |
| 36 | + In the headers, you can set the `resources-arn` / `ce-resources-arn` property to specify the ARN of resources related to the event. |
| 37 | + |
| 38 | + In the headers, you can set the `detail-type` / `ce-detail-type` property to specify the detail type related to the event. |
| 39 | + |
| 40 | + In the headers, you can set the `event-source` / `ce-event-source` property to specify the event source related to the event. |
| 41 | + |
| 42 | + If you do not set the property in the header, the Kamelet uses the given Kamelet properties as a default. |
| 43 | + required: |
| 44 | + - eventbusNameOrArn |
| 45 | + - region |
| 46 | + type: object |
| 47 | + properties: |
| 48 | + eventbusNameOrArn: |
| 49 | + title: Eventbus Name |
| 50 | + description: The Eventbridge Eventbus name or Amazon Resource Name (ARN). |
| 51 | + type: string |
| 52 | + resourcesArn: |
| 53 | + title: Event Resource ARN |
| 54 | + description: The ARN of resources related to the AWS event (e.g. `arn:aws:s3:eu-east-1:000000000001:test`). |
| 55 | + type: string |
| 56 | + eventSourcePrefix: |
| 57 | + title: Event Source Prefix |
| 58 | + description: The event source prefix set for all events sent to the eventbus. |
| 59 | + type: string |
| 60 | + default: "" |
| 61 | + eventSource: |
| 62 | + title: Event Source |
| 63 | + description: The event source related to the AWS event (e.g. `aws.s3`). |
| 64 | + type: string |
| 65 | + detailType: |
| 66 | + title: Event Detail Type |
| 67 | + description: The event detail type related to the AWS event. |
| 68 | + type: string |
| 69 | + accessKey: |
| 70 | + title: Access Key |
| 71 | + description: The access key obtained from AWS. |
| 72 | + type: string |
| 73 | + format: password |
| 74 | + x-descriptors: |
| 75 | + - urn:camel:group:credentials |
| 76 | + secretKey: |
| 77 | + title: Secret Key |
| 78 | + description: The secret key obtained from AWS. |
| 79 | + type: string |
| 80 | + format: password |
| 81 | + x-descriptors: |
| 82 | + - urn:camel:group:credentials |
| 83 | + region: |
| 84 | + title: AWS Region |
| 85 | + description: The AWS region to access. |
| 86 | + type: string |
| 87 | + enum: ["ap-south-1", "eu-south-1", "us-gov-east-1", "me-central-1", "ca-central-1", "eu-central-1", "us-iso-west-1", "us-west-1", "us-west-2", "af-south-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-northeast-3", "ap-northeast-2", "ap-northeast-1", "me-south-1", "sa-east-1", "ap-east-1", "cn-north-1", "us-gov-west-1", "ap-southeast-1", "ap-southeast-2", "us-iso-east-1", "ap-southeast-3", "us-east-1", "us-east-2", "cn-northwest-1", "us-isob-east-1", "aws-global", "aws-cn-global", "aws-us-gov-global", "aws-iso-global", "aws-iso-b-global"] |
| 88 | + useDefaultCredentialsProvider: |
| 89 | + title: Default Credentials Provider |
| 90 | + 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). |
| 91 | + type: boolean |
| 92 | + default: false |
| 93 | + useProfileCredentialsProvider: |
| 94 | + title: Profile Credentials Provider |
| 95 | + description: Set whether the Eventbridge client should expect to load credentials through a profile credentials provider. |
| 96 | + type: boolean |
| 97 | + default: false |
| 98 | + useSessionCredentials: |
| 99 | + title: Session Credentials |
| 100 | + description: Set whether the Eventbridge client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in Eventbridge. |
| 101 | + type: boolean |
| 102 | + default: false |
| 103 | + profileCredentialsName: |
| 104 | + title: Profile Credentials Name |
| 105 | + description: If using a profile credentials provider this parameter sets the profile name. |
| 106 | + type: string |
| 107 | + sessionToken: |
| 108 | + title: Session Token |
| 109 | + description: Amazon AWS Session Token used when the user needs to assume a IAM role. |
| 110 | + type: string |
| 111 | + format: password |
| 112 | + x-descriptors: |
| 113 | + - urn:camel:group:credentials |
| 114 | + uriEndpointOverride: |
| 115 | + title: Overwrite Endpoint URI |
| 116 | + description: The overriding endpoint URI. To use this option, you must also select the `overrideEndpoint` option. |
| 117 | + type: string |
| 118 | + overrideEndpoint: |
| 119 | + title: Endpoint Overwrite |
| 120 | + description: Select this option to override the endpoint URI. To use this option, you must also provide a URI for the `uriEndpointOverride` option. |
| 121 | + type: boolean |
| 122 | + default: false |
| 123 | + dependencies: |
| 124 | + - "camel:core" |
| 125 | + - "camel:aws2-eventbridge" |
| 126 | + - "camel:kamelet" |
| 127 | + template: |
| 128 | + from: |
| 129 | + uri: "kamelet:source" |
| 130 | + steps: |
| 131 | + - choice: |
| 132 | + when: |
| 133 | + - simple: "${header[resources-arn]}" |
| 134 | + steps: |
| 135 | + - setHeader: |
| 136 | + name: CamelAwsEventbridgeResourcesArn |
| 137 | + simple: "${header[resources-arn]}" |
| 138 | + - simple: "${header[ce-resources-arn]}" |
| 139 | + steps: |
| 140 | + - setHeader: |
| 141 | + name: CamelAwsEventbridgeResourcesArn |
| 142 | + simple: "${header[ce-resources-arn]}" |
| 143 | + otherwise: |
| 144 | + steps: |
| 145 | + - setHeader: |
| 146 | + name: CamelAwsEventbridgeResourcesArn |
| 147 | + simple: "{{?resourcesArn}}" |
| 148 | + - choice: |
| 149 | + when: |
| 150 | + - simple: "${header[detail-type]}" |
| 151 | + steps: |
| 152 | + - setHeader: |
| 153 | + name: CamelAwsEventbridgeDetailType |
| 154 | + simple: "${header[detail-type]}" |
| 155 | + - simple: "${header[ce-detail-type]}" |
| 156 | + steps: |
| 157 | + - setHeader: |
| 158 | + name: CamelAwsEventbridgeDetailType |
| 159 | + simple: "${header[ce-detail-type]}" |
| 160 | + otherwise: |
| 161 | + steps: |
| 162 | + - setHeader: |
| 163 | + name: CamelAwsEventbridgeDetailType |
| 164 | + simple: "{{?detailType}}" |
| 165 | + - choice: |
| 166 | + when: |
| 167 | + - simple: "${header[event-source]}" |
| 168 | + steps: |
| 169 | + - setHeader: |
| 170 | + name: CamelAwsEventbridgeSource |
| 171 | + simple: "{{?eventSourcePrefix}}${header[event-source]}" |
| 172 | + - simple: "${header[ce-event-source]}" |
| 173 | + steps: |
| 174 | + - setHeader: |
| 175 | + name: CamelAwsEventbridgeSource |
| 176 | + simple: "{{?eventSourcePrefix}}${header[ce-event-source]}" |
| 177 | + - simple: "${header[ce-source]}" |
| 178 | + steps: |
| 179 | + - setHeader: |
| 180 | + name: CamelAwsEventbridgeSource |
| 181 | + simple: "{{?eventSourcePrefix}}${header[ce-source]}" |
| 182 | + otherwise: |
| 183 | + steps: |
| 184 | + - setHeader: |
| 185 | + name: CamelAwsEventbridgeSource |
| 186 | + simple: "{{?eventSourcePrefix}}{{?eventSource}}" |
| 187 | + - to: |
| 188 | + uri: "aws2-eventbridge:{{eventbusNameOrArn}}" |
| 189 | + parameters: |
| 190 | + secretKey: "{{?secretKey}}" |
| 191 | + accessKey: "{{?accessKey}}" |
| 192 | + region: "{{region}}" |
| 193 | + useDefaultCredentialsProvider: "{{useDefaultCredentialsProvider}}" |
| 194 | + useProfileCredentialsProvider: "{{useProfileCredentialsProvider}}" |
| 195 | + useSessionCredentials: "{{useSessionCredentials}}" |
| 196 | + uriEndpointOverride: "{{?uriEndpointOverride}}" |
| 197 | + profileCredentialsName: "{{?profileCredentialsName}}" |
| 198 | + sessionToken: "{{?sessionToken}}" |
| 199 | + overrideEndpoint: "{{overrideEndpoint}}" |
| 200 | + operation: "putEvent" |
0 commit comments