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

Lambda go1.x runtime deprecated #483

Open
gjwillso opened this issue Mar 8, 2024 · 2 comments
Open

Lambda go1.x runtime deprecated #483

gjwillso opened this issue Mar 8, 2024 · 2 comments

Comments

@gjwillso
Copy link

gjwillso commented Mar 8, 2024

As documented in the below link, the lambda go1.x runtime has now been deprecated by AWS, the provided.al2023 runtime should be used instead.
https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/

This causes the deployment to fail:

runtime = "go1.x"

@moellr
Copy link

moellr commented Mar 8, 2024

A possible quickfix is:

File dce/modules/lambda/lambda.tf (lines 4-5):

OLD:

  runtime       = "go1.x"
  handler       = var.handler

NEW:

  runtime       = "provided.al2"
  handler       = "bootstrap"

File scripts/build.sh (lines 26-30):

OLD:

    GOARCH=amd64 GOOS=linux go build -v -o ../../../bin/lambda/$mod_name
    cd ../../..
    zip -j --must-match \
      bin/lambda/$mod_name.zip \
      bin/lambda/$mod_name

NEW:

    GOARCH=amd64 GOOS=linux go build -v -o ../../../bin/lambda/bootstrap
    cd ../../..
    zip -j --must-match \
      bin/lambda/$mod_name.zip \
      bin/lambda/bootstrap

Tested it myself today on v0.34.1, works.

@rbunny87
Copy link

@moellr tried your solution, deployed successfully but getting error in lambda execution in /api/auth

INIT_REPORT Init Duration: 0.25 ms Phase: invoke Status: error Error Type: Runtime.InvalidEntrypoint
START RequestId: 60323ffe-d998-4121-84c2-13fe13fc9324 Version: $LATEST
RequestId: 60323ffe-d998-4121-84c2-13fe13fc9324 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]
Runtime.InvalidEntrypoint
END RequestId: 60323ffe-d998-4121-84c2-13fe13fc9324
REPORT RequestId: 60323ffe-d998-4121-84c2-13fe13fc9324 Duration: 2.72 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 2 MB

Any help is appreciated...

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

No branches or pull requests

3 participants