You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
Triggermesh AWS custom runtime supports events wrapping for better interoperability of functions and data originated from or targeted at the different platforms. Currently, there are two events wrapper available besides the default "passthrough" one:
130
+
131
+
- API Gateway wrapper ensures that HTTP requests are digestible by the AWS Lambda functions and decodes their responses to the simple readable format
132
+
- CloudEvents wrapper converts function responses into [CloudEvents](https://github.com/cloudevents/spec/blob/v1.0/README.md) event objects.
133
+
134
+
Events wrapper can be enabled by setting function's environment variables and may have different set of configurable parameters. Let's take a look at CloudEvens example:
135
+
136
+
1. Generate sample Go function using [tm](https://github.com/triggermesh/tm) CLI
137
+
```
138
+
tm generate go
139
+
```
140
+
141
+
1. Open go/serverless.yaml deployment manifest and add events wrapper env variables:
142
+
```
143
+
...
144
+
environment:
145
+
RESPONSE_WRAPPER: CLOUDEVENTS
146
+
CE_TYPE: go-klr-cloudevent
147
+
...
148
+
```
149
+
1. Deploy function:
150
+
```
151
+
tm deploy -f go --wait
152
+
```
153
+
154
+
After CLI report that deployment is succeeded, send a request to the function endpoint:
The result will be encoded into CloudEvents format:
161
+
162
+
```
163
+
Validation: valid
164
+
Context Attributes,
165
+
specversion: 1.0
166
+
type: go-klr-cloudevent
167
+
source: go-demo-service-go-function
168
+
subject: klr-response
169
+
id: 7fa17c84-56f0-488a-b7de-e45d7fb3b7b1
170
+
datacontenttype: application/json
171
+
Data (binary),
172
+
"Hello Joe!"
173
+
```
174
+
175
+
## Support
129
176
130
177
We would love your feedback on this tool so don't hesitate to let us know what is wrong and how we could improve it, just file an [issue](https://github.com/triggermesh/aws-custom-runtime/issues/new)
131
178
132
-
###Code of Conduct
179
+
## Code of Conduct
133
180
134
181
This plugin is by no means part of [CNCF](https://www.cncf.io/) but we abide by its [code of conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)
0 commit comments