Skip to content

Commit 94fff7c

Browse files
authored
fix(#98): Enhance AWS Eventbridge sink (#100)
- Allow deployment EnvVar settings for resources-arn, detail-type and event-source - Users are still able to overwrite these settings with CloudEvent attributes (ce-resources-arn, ce-detail-type and ce-event-source)
1 parent 047dd32 commit 94fff7c

File tree

7 files changed

+297
-16
lines changed

7 files changed

+297
-16
lines changed

aws-eventbridge-sink/README.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,38 @@ This results in an EventBridge event that looks like this:
116116
}
117117
----
118118

119+
As an alternative to providing this via CloudEvent attributes you can use EnvVar settings to set some default values.
120+
121+
|===
122+
|Property |Required |EnvVar |Description
123+
124+
|eventbusNameOrArn
125+
|yes
126+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENTBUS_NAME_OR_ARN=<the_eventbusNameOrArn>
127+
|The Eventbridge Eventbus name or Amazon Resource Name (ARN).
128+
129+
|resourcesArn
130+
|no
131+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_RESOURCES_ARN=<the_resourcesArn>
132+
|The ARN of resources related to the AWS event (e.g. `arn:aws:s3:eu-east-1:000000000001:test`).
133+
134+
|eventSourcePrefix
135+
|no
136+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENT_SOURCE_PREFIX=<the_eventSourcePrefix>
137+
|The event source prefix set for all events sent to the eventbus. (default is `knative-connect.`)
138+
139+
|eventSource
140+
|no
141+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENT_SOURCE=<the_eventSource>
142+
|The event source related to the AWS event (e.g. `aws.s3`).
143+
144+
|detailType
145+
|no
146+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_DETAIL_TYPE=<the_detailType>
147+
|The event detail type related to the AWS event (e.g. `Object Created`).
148+
149+
|===
150+
119151
== Configuration
120152

121153
Each Kamelet defines a set of properties.

aws-eventbridge-sink/properties.adoc

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
|===
22
|Property |Required |EnvVar |Description
33

4-
|eventSourcePrefix
5-
|no
6-
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENT_SOURCE_PREFIX=<the_eventSourcePrefix>
7-
|The AWS EventBridge source prefix for all events sent to the eventbus. (default is `knative-connect.`)
8-
94
|eventbusNameOrArn
105
|yes
116
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENTBUS_NAME_OR_ARN=<the_eventbusNameOrArn>
127
|The Eventbridge Eventbus name or Amazon Resource Name (ARN).
138

9+
|resourcesArn
10+
|no
11+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_RESOURCES_ARN=<the_resourcesArn>
12+
|The ARN of resources related to the AWS event (e.g. `arn:aws:s3:eu-east-1:000000000001:test`).
13+
14+
|eventSourcePrefix
15+
|no
16+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENT_SOURCE_PREFIX=<the_eventSourcePrefix>
17+
|The event source prefix set for all events sent to the eventbus. (default is `knative-connect.`)
18+
19+
|eventSource
20+
|no
21+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_EVENT_SOURCE=<the_eventSource>
22+
|The event source related to the AWS event (e.g. `aws.s3`).
23+
24+
|detailType
25+
|no
26+
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_DETAIL_TYPE=<the_detailType>
27+
|The event detail type related to the AWS event (e.g. `Object Created`).
28+
1429
|accessKey
1530
|no
1631
|CAMEL_KAMELET_AWS_EVENTBRIDGE_SINK_ACCESS_KEY=<the_accessKey>

aws-eventbridge-sink/properties.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ spec:
1111
type: string
1212
title: Eventbus Name
1313
description: The Eventbridge Eventbus name or Amazon Resource Name (ARN).
14+
resourcesArn:
15+
title: Resources ARN
16+
description: The ARN of resources related to the AWS event (e.g. `arn:aws:s3:eu-east-1:000000000001:test`).
17+
type: string
18+
eventSourcePrefix:
19+
title: Event Source Prefix
20+
description: The event source prefix set for all events sent to the eventbus.
21+
type: string
22+
eventSource:
23+
title: Event Source
24+
description: The event source related to the AWS event (e.g. `aws.s3`).
25+
type: string
26+
detailType:
27+
title: Detail Type
28+
description: The event detail type related to the AWS event (e.g. `Object Created`).
29+
type: string
1430
accessKey:
1531
type: string
1632
title: Access Key

aws-eventbridge-sink/src/main/resources/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,3 @@ camel.component.knative.typeId=
3232
# ConfigMap and secret based configuration
3333
camel.kubernetes-config.mount-path-configmaps=/etc/camel/conf.d/_configmaps/kn-sink-config
3434
camel.kubernetes-config.mount-path-secrets=/etc/camel/conf.d/_secrets/kn-sink-config
35-
36-
# Default source prefix for all events sent to the event bus
37-
camel.kamelet.aws-eventbridge-sink.event.source.prefix=knative-connect.

aws-eventbridge-sink/src/main/resources/camel/sink.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,11 @@ spec:
2727
name: default
2828
properties:
2929
type: ""
30-
steps:
31-
- ref:
32-
kind: Kamelet
33-
apiVersion: camel.apache.org/v1
34-
name: insert-header-action
35-
properties:
36-
name: event-source
37-
value: "{{camel.kamelet.aws-eventbridge-sink.event.source.prefix}}${header[ce-event-source]}"
3830
sink:
3931
ref:
4032
kind: Kamelet
4133
apiVersion: camel.apache.org/v1
4234
name: aws-eventbridge-sink
35+
properties:
36+
# Default source prefix for all events sent to the event bus
37+
eventSourcePrefix: "knative-connect."
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
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+PGxpbmVhckdyYWRpZW50IGlkPSJJY29uaWZ5SWQtMTgyM2Y2NTU1NjktYWYxZGQ1LTIwMzYiIHgxPSIwJSIgeDI9IjEwMCUiIHkxPSIxMDAlIiB5Mj0iMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNCMDA4NEQiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNGRjRGOEIiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cGF0aCBmaWxsPSJ1cmwoI0ljb25pZnlJZC0xODIzZjY1NTU2OS1hZjFkZDUtMjAzNiki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41ODEtMTIuNTEgMTIuNDQyLTEyLjUxYzYuODU3IDAgMTIuNDM5IDUuNjEgMTIuNDM5IDEyLjUxYzAgNi44OTYtNS41ODIgMTIuNTA4LTEyLjQ0IDEyLjUwOFptMTAuMzkzIDMuMjM2YzUuMDYyLTMuMzkyIDguNDEtOS4xODEgOC40MS0xNS43NDRjMC0xMC40MjYtOC40MzYtMTguOTEtMTguODAzLTE4LjkxYy0zLjAwNCAwLTUuODMzLjczLTguMzUzIDEuOTk0TDQ4LjQ1OCAxMjhsMTguNDI4LTMyLjA5M2wtNS41MTUtMy4yTDQyLjAyNyAxMjYuNGEzLjIxIDMuMjEgMCAwIDAgMCAzLjJsMTIuMzg4IDIxLjU2OGMtMy4yNjggMy40MDUtNS4yODkgOC4wMjItNS4yODkgMTMuMTE0YzAgMTAuNDI1IDguNDM2IDE4LjkwOCAxOC44MDcgMTguOTA4YzEuNTYyIDAgMy4wNzQtLjIxNCA0LjUyOC0uNTc5bDEwLjE1IDE3LjY4Yy41Ny45ODkgMS42MiAxLjYgMi43NTcgMS42aDM5LjQ1MXYtNi40SDg3LjIwNGwtOC44NzgtMTUuNDY1WiIvPjwvc3ZnPg=="
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"

aws-eventbridge-sink/src/test/java/dev/knative/eventing/connector/AwsEventBridgeSinkTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,29 @@ public class AwsEventBridgeSinkTest implements ContainerLifecycleListener<LocalS
7575

7676
@Test
7777
public void shouldConsumeEvents() {
78+
tc.given(
79+
http().client(knativeTrigger)
80+
.send()
81+
.post("/")
82+
.message()
83+
.body(eventData)
84+
.header("ce-id", "citrus:randomPattern([0-9A-Z]{15}-[0-9]{16})@")
85+
.header("ce-type", "dev.knative.eventing.aws.eventbridge")
86+
.header("ce-source", "dev.knative.eventing.aws-eventbridge-source")
87+
.header("ce-subject", "aws-eventbridge-source")
88+
);
89+
90+
tc.when(
91+
http().client(knativeTrigger)
92+
.receive()
93+
.response(HttpStatus.NO_CONTENT)
94+
);
95+
96+
tc.then(this::verifySqsEvent);
97+
}
98+
99+
@Test
100+
public void shouldOverwriteCloudEventAttributes() {
78101
tc.given(
79102
http().client(knativeTrigger)
80103
.send()
@@ -188,6 +211,9 @@ public Map<String, String> started(LocalStackContainer container) {
188211
conf.put("camel.kamelet.aws-eventbridge-sink.secretKey", container.getSecretKey());
189212
conf.put("camel.kamelet.aws-eventbridge-sink.region", container.getRegion());
190213
conf.put("camel.kamelet.aws-eventbridge-sink.eventbusNameOrArn", eventBusName);
214+
conf.put("camel.kamelet.aws-eventbridge-sink.resourcesArn", "arn:aws:s3:us-east-1:000000000000:my-bucket");
215+
conf.put("camel.kamelet.aws-eventbridge-sink.eventSource", "aws.s3");
216+
conf.put("camel.kamelet.aws-eventbridge-sink.detailType", "Object Created");
191217
conf.put("camel.kamelet.aws-eventbridge-sink.uriEndpointOverride", container.getServiceEndpoint().toString());
192218
conf.put("camel.kamelet.aws-eventbridge-sink.overrideEndpoint", "true");
193219
conf.put("camel.kamelet.aws-eventbridge-sink.forcePathStyle", "true");

0 commit comments

Comments
 (0)