Skip to content
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

[Github app]: AAUser, I can hit a github webhook and my request is routed to the lambda function #242

Open
10 of 12 tasks
mattzcarey opened this issue Sep 4, 2023 · 1 comment
Assignees

Comments

@mattzcarey
Copy link
Owner

mattzcarey commented Sep 4, 2023

Description:

We need to have one webhook API Gateway endpoint.
This should be at a custom URL webhook-api.oriontools.ai and webhook-api.staging.oriontools.ai
We need to separate out the review lambda from the core api and create a new api - webhookapi.
This should route to the correct lambda function depending on the action property in the body. [this will be done in ticket #265 ]

Validation:
Screenshot of new webhook stack
Ping the API gateway with a sample event and it triggers the reviewLambda

Tech steps:

  • In services/core create a webhook-stack.ts

  • create a webhookapi and give it a custom domain as above.

  • You will need to add ARecords for the subdomains in the hostedzone in route53. [DONE in api construct]

  • You will need to then create a certificate in certificates manager for that subdomain and validate it with the record.

  • You will need to store that certificate arn in Parameter store (see how it is done for the core stack)

  • You should move the postReview Lambda to this stack. and delete the root on the coreapi for this lambda

  • We then need an event bus in this stack

  • We then need to add a direct integration of apigateway to eventbridge: https://serverlessland.com/patterns/apigateway-http-eventbridge-cdk [not applicable anymore]

  • https://aws.amazon.com/blogs/compute/capturing-client-events-using-amazon-api-gateway-and-amazon-eventbridge/= [not applicable anymore]

  • Add an eventbridge rule trigger to lambda which matches all events

ADDED:

  • Create the routing Lambda, this will take in an ApiGateway event. We need to take the request, and put it into a event bridge event and post it onto the event bus.
  • Update review lambda to take in a event body
@mattzcarey mattzcarey changed the title [Github app]: AAUser I can hit a github webhook and my request is routed to the correct lambda function [Github app]: AAUser I can hit a github webhook and my request is routed to the lambda function Sep 4, 2023
@mattzcarey mattzcarey added this to the v2 - SaaS platform milestone Sep 4, 2023
@mattzcarey mattzcarey self-assigned this Sep 8, 2023
@lizacullis lizacullis changed the title [Github app]: AAUser I can hit a github webhook and my request is routed to the lambda function [Github app]: AADev, I have a seperate webhook api that will be used for routing webhook requests Sep 11, 2023
@lizacullis lizacullis changed the title [Github app]: AADev, I have a seperate webhook api that will be used for routing webhook requests [Github app]: AAUser, I can hit a github webhook and my request is routed to the lambda function Sep 11, 2023
@lizacullis
Copy link
Collaborator

lizacullis commented Sep 13, 2023

Validation:

Webhook stack:

Image

Postman request:

Image

Lambda Triggered :

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Functional Review
Development

No branches or pull requests

2 participants