-
Notifications
You must be signed in to change notification settings - Fork 546
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
Does this runtime still use an extra RPC hop by default when used with SAM, and if so, how to disable it? #482
Comments
Hi @refacktor,
Yes, adding a go
I'm not a big SAM user, but after having a quick look at the default GoModulesBuilder, it seems not to be supported out of the box. However, you could achieve it with a custom make file. |
If you install an up-to-date version of SAM, you will see 'sam init' offers a 'go (provided.al2)' option in the Hello World samples. This shows how to set up a SAM template for a function using Go on provided.al2. In summary:
Using the 'BuildMethod' means you no longer need to use a Makefile. Here's an example template section:
|
Closing, please flag if anything else required. |
According to this article from December 2021, titled "Using a Custom Runtime for Go-Based Lambda Functions,"
Is this still accurate in 2023?
The article also provides instructions on how to switch to a more efficient configuration that bypasses RPC:
and remove unused libraries
it even provides a revised build command:
However, this last point is what's giving me some difficulty. I'm using
aws-lambda-go
indirectly via SAM (sam init
). It is not clear where the above build command can be inserted. It is also not clear whether it's even necessary at this time, about 14 months later.Any clarification or hints on how to investigate this further, would be great.
The text was updated successfully, but these errors were encountered: