-
Notifications
You must be signed in to change notification settings - Fork 118
[Example] Add APIGatewayV1 example #569
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
Conversation
Thank you for this PR. I suggested two minor changes in the review. Can you also add this test to the CI (this line)? I like your suggestion to rename to existing APIGateway example to If you have time, can you submit a PR for this change too (don't forget to change the CI too :-) ) |
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.
LGTM, just two tiny changes
// | ||
// This source file is part of the SwiftAWSLambdaRuntime open source project | ||
// | ||
// Copyright (c) 2024 Apple Inc. and the SwiftAWSLambdaRuntime project authors |
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.
I would update this to 2025
Examples/APIGatewayV1/template.yaml
Outdated
Timeout: 60 | ||
Handler: swift.bootstrap # ignored by the Swift runtime | ||
Runtime: provided.al2 | ||
MemorySize: 512 |
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.
I know it's coming from the example you copied, but I would use 128Mb here. This is enough to run the function and it reduces costs for customers.
I will add a GH issue to remember doing the same on all SAM examples.
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.
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.
Thank you !
This PR adds an APIGateway V1 example, which differs slightly from the existing V2 example.
Motivation:
While APIGatewayV2 has existed for a while, there are still some scenarios where V1 is preferable (see Choose between REST APIs and HTTP APIs for more details). This PR adds a working example for the
Api
endpoint type.Modifications:
Sources/main.swift
template.yaml
Type: Api
values.GET
endpoint for anApi
endpoint.Readme.md
Result:
Now, an APIGateway and APIGatewayV1 example exist.
Note
It is the author's opinion that this new example should technically be called
APIGateway
and the existing one should be renamed toAPIGatewayV2
to keep consistent with the request and response type naming conventions, but this is omitted from this request to be less disruptive.