Skip to content
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

Update to provided.al2 runtime (Go 1.x runtime deprecated by AWS) #15

Closed
drocco007 opened this issue Aug 28, 2023 · 0 comments · Fixed by #16
Closed

Update to provided.al2 runtime (Go 1.x runtime deprecated by AWS) #15

drocco007 opened this issue Aug 28, 2023 · 0 comments · Fixed by #16

Comments

@drocco007
Copy link
Contributor

Hi. AWS is deprecating the Go 1.x Lambda runtime and requiring Go-based Lambdas to use the provided.al2 runtime instead.

There are a handful of minor snags to migrating this project:

  • glibc library version mismatch between the development and runtime environments. The Goreleaser config file already disables CGO (build: disable CGO #12), so it seems safe to do the same in the makefile.
  • the provided.al2 runtime requires a specific executable name: the handler executable must be called bootstrap
  • the runtime also requires bootstrap to be placed in one of two specific locations: either /var/run/task (the Lambda package itself) or /opt (a Lambda layer). As currently packaged, the executable is placed in a bin/ subdirectory, which the runtime will not execute, even if the Lambda configuration attempts to reference it exactly.

For the last problem, I tested out the idea of using the makefile to generate the zip file — without the bin/ prefix — and then using the artifact attribute in the serverless config to have the deploy step use that zip instead of packaging up a new one. Alternatively we could have make dump the bootstrap binary directly into the project root and let serverless continue to handle packaging.

drocco007 added a commit to drocco007/ecs-drain-lambda that referenced this issue Aug 29, 2023
Update the service runtime ahead of the deprecation of the go1.x runtime by
AWS.

* disable CGO during build to avoid glibc version mismatch

* rename the executable `bootstrap` and place it in the task root directory
  as required by the new runtime

Closes getsocial-rnd#15
taraspos pushed a commit that referenced this issue Oct 15, 2023
Update the service runtime ahead of the deprecation of the go1.x runtime by
AWS.

* disable CGO during build to avoid glibc version mismatch

* rename the executable `bootstrap` and place it in the task root directory
  as required by the new runtime

Closes #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant