serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

feat: support Go on provided.al2 runtime

Open davidjb opened this issue 2 years ago • 8 comments

Description

This adds support for the current Go runtime, provided.al2, used on AWS Lambda.

Motivation and Context

The go1.x runtime is EOL as its underlying AMI became EOL on 2020-12-31 and provided.al2 is its replacement (https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/). Whilst the AMI is still under technically under extended maintenance support, this extends only until 2023-12-31 (https://aws.amazon.com/blogs/aws/update-on-amazon-linux-ami-end-of-life/).

The method here for checking the runtime and the handler's suffix (e.g. its file extension) may appear somewhat brittle but the GoRunner's internals implicitly require the .go source to be available and thus the handler already needs to be some/path/function.go.

How Has This Been Tested?

Added integration tests with provided.al2 runtime and Go handler. Also tested locally in my current project.

Screenshots (if appropriate):

davidjb avatar May 10 '23 01:05 davidjb

We need this functionality to run offline using go in the provided.al2 runtime

jaimeniswonger avatar Aug 29 '23 18:08 jaimeniswonger

Why hasn't this been merged?

kevingilbert100 avatar Dec 20 '23 00:12 kevingilbert100

Just an FYI on this: provided.al2023 has been released in the time since I opened this PR (https://docs.aws.amazon.com/linux/al2023/ug/lambda.html) so support for that needs to be added as well. We switched over to using SAM so I'll leave that for others to implement.

davidjb avatar Dec 20 '23 00:12 davidjb

any news ?????

nicolas-serbin avatar Jan 22 '24 17:01 nicolas-serbin

As the go1.x runtime is now officially deprecated and will not get any security updates the new runtimes provided.al2 and provided.al2023 need to be supported for golang to run locally.

Cr4mble avatar Feb 27 '24 08:02 Cr4mble

gotta be accepted @dherault

AntonyOnScript avatar Mar 04 '24 19:03 AntonyOnScript

@davidjb your branch didn't work for me (I kept getting errors related to lambci). Does this PR require changes from https://github.com/dherault/serverless-offline/pull/1755 ?

AnalogJ avatar Mar 18 '24 21:03 AnalogJ

Hi, this PR haas been open for a long time but still holds value for the community. I'm willing to merge it if someone would fix its conflict and/or re-open it.

dherault avatar Aug 17 '24 19:08 dherault