-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for custom HTTP invocations #1185
Comments
Just to clarify, the Envoy proxy payload is not following the API Gateway v2 payload? |
Something that will be on the new runtime i BREF-specific input that can be understood as an HTTP request, such as |
@mnapoli you can define
@deleugpn would that mean we could set configure the handler to check for |
@jasonmccallister ok so what is not working? Can you clarify what the problem is here?
Is that compatible with API Gateway payload v2? |
@mnapoli there are two issues.
As far as #1, we could add another if statement that checks for We could resolve #2 by updating the code here to something like this: public function isFormatV2(): bool
{
return $this->payloadVersion === 2.0 || array_key_exists('method', $this->event);
} Diving through the existing code and talking it out here, it seems like it might not be a large lift to add support for this type of payload. Want me to make a PR with those proposed changes? I'm sure there are some other methods that will probably need updates. |
Bref web functions expect to be invoked by either an API Gateway or ALB. It would be nice if Bref was able to handle HTTP events from different types of sources. However, there are many other invocation methods, including direct invocation using the AWS CLI, but invoking the lambda function without an API Gateway or ALB event type results in the following error (which is currently the expected behavior):
One tool that has Lambda integration is Envoy Proxy which requires the Lambda to return an API Gateway V2 type response but the incoming request/event looks like this:
I think there are some things to consider if this was to be implemented.
Accepting the event type
We could update the HttpHandler to also accept the payload above, but then the response (as the code is right now) is looking for a version 2 in the payload to return the API Gateway V2 response.
Force returning V2 response
That could be resolved by setting some kind of variable
BREF_RESPONSE_V2
(naming leaves a lot for desire) and when that is set the response will always be return as V2 compatible.Wanted to start the discussion before making a PR to add this feature.
Example with Envoy
If you wanted to try this with Envoy, you can use this Envoy configuration file (change
ACCOUNT
,FUNCTION
, andREGION
to the correct values) and runningenvoy -c envoy.yaml
.The text was updated successfully, but these errors were encountered: