dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.19k stars 796 forks source link

feat: support Go on provided.al2 runtime #1691

Open davidjb opened 1 year ago

davidjb commented 1 year ago

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):

jaimeniswonger commented 1 year ago

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

kevingilbert100 commented 8 months ago

Why hasn't this been merged?

davidjb commented 8 months ago

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.

nicolas-serbin commented 7 months ago

any news ?????

Cr4mble commented 6 months ago

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.

AntonyOnScript commented 6 months ago

gotta be accepted @dherault

AnalogJ commented 5 months ago

@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 ?

dherault commented 2 weeks ago

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.