-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add API Gateway Local setup #200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent, thank you!
server/template.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if we could somehow avoid the duplication between this and
wewerewondering/infra/apigw.tf
Lines 58 to 88 in 77525cb
resource "aws_apigatewayv2_route" "api_event_post" { | |
api_id = aws_apigatewayv2_api.www.id | |
route_key = "POST /api/event" | |
target = "integrations/${aws_apigatewayv2_integration.www.id}" | |
} | |
resource "aws_apigatewayv2_route" "api_event_eid_post" { | |
api_id = aws_apigatewayv2_api.www.id | |
route_key = "POST /api/event/{eid}" | |
target = "integrations/${aws_apigatewayv2_integration.www.id}" | |
} | |
resource "aws_apigatewayv2_route" "api_event_eid_get" { | |
api_id = aws_apigatewayv2_api.www.id | |
route_key = "GET /api/event/{eid}" | |
target = "integrations/${aws_apigatewayv2_integration.www.id}" | |
} | |
resource "aws_apigatewayv2_route" "api_route" { | |
for_each = { | |
get_eeq = "GET /api/event/{eid}/questions", | |
get_eeqs = "GET /api/event/{eid}/questions/{secret}", | |
post_toggle = "POST /api/event/{eid}/questions/{secret}/{qid}/toggle/{property}", | |
get_q = "GET /api/questions/{qids}", | |
post_vote = "POST /api/vote/{qid}/{updown}", | |
} | |
api_id = aws_apigatewayv2_api.www.id | |
route_key = each.value | |
target = "integrations/${aws_apigatewayv2_integration.www.id}" | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You think we could open an issue for that so that if the number of endpoints grows and we feel burden, we can optimize this.
I am actually always using the axum app without lambda layer plus DynamoDB Local when testing stuff end-to-end locally. It just works as you point out here
I can see though how having API Gateway Local setup might be useful - we can check that the mapping really works and that the request reaches axum
app as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also I really love how things a described and organized in infra
with Terraform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, opening a ticket to do that as a follow-up seems reasonable to me!
Honestly, the other path we could take is to just have a custom check in CI that the two match up.
The next question now is: can we get CI to also run (and succeed with) |
it is my pleasure, as for this thread, since we are talking to the So we just need to add the flag on the CI, I will open a chaser. But I think what you mean here, is more about how do we test the lambda-power app (i.e. the LambdaLayer'ed app in release mode). I think this implies launching The ultimate test though would imply launching the wewerewondering client and the server in release mode behind API Gateway Local (and talking to DynamoDB Local), then acting on the client side and making some assertions (we already got this thread) |
A bit of all of the above. I'm arguably mixing up a bunch of different thoughts here, so let me put them in a new issue. Give me a sec. |
Addresses #196