Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Conversation

tzununbekov
Copy link
Member

@tzununbekov tzununbekov commented May 13, 2021

  • Lambda-Runtime-Cloudevents-Context header added to the task API to provide additional context,
  • Since function's context is the root object for AWS Lambda function metadata, Cloudevents context is stored under the dedicated map ce, and can be accessed as shown below:
    def foo(event, context):
      print("CE Type is " + context.ce['type'])
    

More runtimes support is coming.

Related to triggermesh/function#13
Depends on triggermesh/aws-custom-runtime#32

@tzununbekov tzununbekov self-assigned this May 14, 2021
@tzununbekov tzununbekov marked this pull request as ready for review May 14, 2021 08:02
@antoineco
Copy link

Is the capital letter expected in your example? If that's the case, we should fix it because a CE attributes can only be [a-z0-9], any other character is invalid and causes CE receivers to drop events as invalid.

@tzununbekov
Copy link
Member Author

tzununbekov commented May 14, 2021

Is the capital letter expected in your example? If that's the case, we should fix it because a CE attributes can only be [a-z0-9], any other character is invalid and causes CE receivers to drop events as invalid.

Let me check that because one of the layers between the client and the function converts all these headers to Ce-Type format.

UPD: fixed in triggermesh/aws-custom-runtime@58d9e40#diff-d87d46428a3537e6c7b240e87dff7f0dcf65d349c847622556d0b4f695f579eeR146

@tzununbekov tzununbekov merged commit 358d399 into master May 18, 2021
@tzununbekov tzununbekov deleted the ce-context branch May 18, 2021 06:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants