serverless-go-plugin
serverless-go-plugin copied to clipboard
[go1.x runtime deprecation] Endpoint request timed out
Due to the go1.x
runtime deprecation, I am trying to use the custom runtime provided.al2
.
However, the endpoint now gives the error "Endpoint request timed out" after deployment.
Any advice is appreciated.
Here is my configuration:
service: my-service
frameworkVersion: '3'
provider:
name: aws
runtime: provided.al2
architecture: arm64
stage: ${opt:stage, 'dev'}
region: us-east-1
environment: ${file(.env.${self:provider.stage}.yml)}
package:
patterns:
- '!./**'
- './bin/**'
functions:
receive:
handler: receive/main.go
events:
- http:
path: ${self:custom.functionPath.${self:provider.stage}}/receive
method: post
timeout: 30
memorySize: 128
verify:
handler: verify/main.go
events:
- http:
path: ${self:custom.functionPath.${self:provider.stage}}/receive
method: get
timeout: 30
memorySize: 128
custom:
go:
supportedRuntimes: provided.al2
buildProvidedRuntimeAsBootstrap: true
cmd: GOARCH=arm64 GOOS=linux go build -tags lambda.norpc -ldflags="-s -w"
plugins:
- serverless-go-plugin
I'm also trying to migrate to provided.al2
but the deploy fails. I have multiple lambdas. I have noticed that using the provided.al2
runtime does not create any entry in the .bin
folder. It creates one main.zip
file in the .serverless
folder without any bootstrap entry file. Please advise.
there is an issue on the plugin when adding buildProvidedRuntimeAsBootstrap
as true to use provided.al2 runtime, if you don't have declared old include
and exclude
package options. I'll send a PR in some hours to fix this
I've also recommend to remove the package
config and let the plugin build it for you.
Here a PR with the fix!!! https://github.com/mthenw/serverless-go-plugin/pull/43
Thank you @danteay, will check it next week and will let you know.
@danteay it seems its working, thank you! Will be performing more tests and will report back if anything pops up. Just for future reference, these are the configs that I have
go:
cmd: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" # compile command
supportedRuntimes: ["provided.al2"]
buildProvidedRuntimeAsBootstrap: true
The yaml doesn't contain the package include or exclude properties.
@ivaylopivanov how do you test it if the PR is still open?
@ivaylopivanov how do you test it if the PR is still open?
You can install the plugin with npm pointing to a specific commit.
@ivaylopivanov @jpsolofunds As my PR was ghosted I've forked and modified the plugin to just work with new AWS configuration and fix other issues that I've found in the process!!
Feel free to test it and give me feedback!!
(release will come soon)
https://github.com/Drafteame/serverless-plugin-go
In my case, applying this issue's workaround did not solve the problem.
The problem was caused by an old version of aws/aws-lambda-go
(eg: v1.6.0
) , and the timeout was resolved by upgrading to latest (eg: v1.41.0
. )
https://github.com/aws/aws-lambda-go/releases/tag/v1.41.0