Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit dadda93

Browse files
authored
Merge pull request #39 from triggermesh/oracle-targets
Oracle targets
2 parents 78d2929 + dcad13b commit dadda93

File tree

2 files changed

+37
-88
lines changed

2 files changed

+37
-88
lines changed

docs/targets/aws.md

Lines changed: 33 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,55 @@
11
# AWS Target for Knative Eventing
22

3-
This event target allows for invoking several types of AWS services. Currently,
4-
this target supports:
5-
* Lambdas
6-
* SNS
7-
* SQS
8-
* Kinesis
3+
This event target receives [CloudEvents][ce] over HTTP, and can send to a
4+
defined AWS service. Currently, this target supports:
95

10-
## Prerequisites
11-
12-
Utilizing any of the AWS services requires that they already exist, and the AWS
13-
credentials in use will have access to invoke the underlying services.
14-
15-
## Controller Deployment
16-
17-
### Kubernetes Manifests
18-
19-
// TODO use our images
20-
21-
### From Code
22-
23-
You can use the [ko](https://github.com/google/ko) tool to compile and deploy from source.
24-
25-
```console
26-
ko create -f ./config
27-
```
6+
- Lambdas
7+
- SNS
8+
- SQS
9+
- Kinesis
2810

29-
## Adding the AWS Secrets
30-
31-
A set of AWS API keys will need to be created and added to the same namespace
32-
hosting the target, and would resemble:
11+
## Prerequisites
3312

34-
```yaml
35-
apiVersion: v1
36-
kind: Secret
37-
metadata:
38-
name: aws
39-
type: Opaque
40-
stringData:
41-
AWS_ACCESS_KEY_ID: <REPLACE ME WITH A REAL KEY>
42-
AWS_SECRET_ACCESS_KEY: <REPLACE ME WITH A REAL SECRET>
43-
```
13+
Utilizing any of the AWS services requires that the targeted services already
14+
exist, and the AWS API credentials in use will have access to invoke the
15+
underlying services.
4416

4517
## Creating an AWS Service Target
4618

47-
Once the AWS Target Controller has been deployed, a target for Lambdas, SNS, and
48-
SQS can be created by defining an AwsTarget object:
19+
At Triggermesh, create a new aws secret based on the API credentials from the
20+
prerequisites.
4921

22+
A sample target would resemble the following:
5023
```yaml
5124
apiVersion: targets.triggermesh.io/v1alpha1
5225
kind: AWSTarget
5326
metadata:
54-
name: triggermesh-aws-lambda
27+
name: <UNIQUE TARGET NAME>
5528
spec:
56-
lambda:
57-
arn: arn:aws:lambda:us-west-2:043455440429:function:snslistener
29+
<AWS SERVICE>:
30+
arn: <SERVICE ARN>
31+
partition: <KINESIS PARTITION>
5832
awsApiKey:
5933
secretKeyRef:
6034
name: aws
61-
key: AWS_ACCESS_KEY_ID
35+
key: aws_access_key_id
6236
awsApiSecret:
6337
secretKeyRef:
6438
name: aws
65-
key: AWS_SECRET_ACCESS_KEY
39+
key: aws_secret_access_key
6640
```
6741
68-
The sub spec can be one of: lambda, sns, sqs, or kenisis. Note that the Kinesis target will be a little different:
69-
```yaml
70-
apiVersion: targets.triggermesh.io/v1alpha1
71-
kind: AWSTarget
72-
metadata:
73-
name: triggermesh-aws-kinesis
74-
spec:
75-
kinesis:
76-
arn: arn:aws:kinesis:us-west-2:043455440429:stream/cabtest
77-
partition: "test"
78-
awsApiKey:
79-
secretKeyRef:
80-
name: aws
81-
key: AWS_ACCESS_KEY_ID
82-
awsApiSecret:
83-
secretKeyRef:
84-
name: aws
85-
key: AWS_SECRET_ACCESS_KEY
86-
```
87-
88-
_NOTE: The `AWS_ACCESS_KEY` and `AWS_SECRET_ACCESS_KEY` secrets must be installed
89-
and accessible to the target service_.
42+
When used in the Bridge, ensure that the Generic Target is used, and when copying the sample target yaml from above, replace `<AWS SERVICE>` with:
9043

91-
## AWS Target as an Event Sink
44+
- lambda
45+
- sns
46+
- sqs
47+
- kinesis
9248

93-
Lastly, a triggering mechanism needs to be added to listen for a Knative
94-
event.
49+
In addition, the `partition` line is required and the `<KINESIS PARTITION>` entry
50+
will need to be updated with the Kinesis partition name. Otherwise, it can be removed.
9551

96-
```yaml
97-
apiVersion: eventing.knative.dev/v1beta1
98-
kind: Trigger
99-
metadata:
100-
name: aws-sample-lambda-trigger
101-
spec:
102-
broker: default
103-
subscriber:
104-
ref:
105-
apiVersion: targets.triggermesh.io/v1alpha1
106-
kind: AWSTarget
107-
name: triggermesh-aws-lambda
108-
109-
```
110-
111-
For additional samples, take a look at the [samples](samples/) path.
52+
Lastly, update `<UNIQUE TARGET NAME>` to reflect a name for the target that will be referenced by the bridge trigger.
11253

11354
## Triggering an AWS Service via the Target
11455

@@ -125,4 +66,9 @@ curl -v http://triggermesh-aws-lambda.default.svc.cluster.local \
12566
-H "Ce-Source: awesome/instance" \
12667
-H "Ce-Id: 536808d3-88be-4077-9d7a-a3f162705f79" \
12768
-d '{"greeting":"Hi from TriggerMesh"}'
128-
```
69+
```
70+
71+
*NOTE*: The body of the event is freeform and meant to be interpreted by the
72+
target service.
73+
74+
[ce]: https://cloudevents.io

docs/targets/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ The following is a list of Triggermesh event Destinations known as Targets. Some
44

55
## Current TriggerMesh Targets
66

7+
* [AWS](./aws.md): Forward events to AWS services such as Lambda, SNS, SQS, and Kinesis.
78
* [AWS EventBridge](./awseventbridge.md): Forward arbitrary events to AWS EventBridge.
9+
* [Elasticsearch](./elasticsearch.md): Send events to Elasticsarch to be indexed.
810
* [Oracle](./oracle.md): Forward events to the Oracle Cloud.
9-
* [Splunk](./splunk.md): Forward arbitrary events to Splunk
11+
* [Slack](./slack.md): Forward events to Slack as messages to deliver immediately, scheduled, or as an update to a pre-existing message.
12+
* [Splunk](./splunk.md): Forward arbitrary events to Splunk

0 commit comments

Comments
 (0)