I'm trying to migrate to the AL2 runtime from go1.x to deploy my Lambda functions but I'm having troubles with how to do so. I use the Serverless Framework for deployment in conjunction with make. Here is the Makefile that I currently use:
go_apps = bin/func1 bin/func2 bin/fun3 bin/% : functions/%.go functions/common.go env GOOS=linux go build -ldflags="-s -w" -o $@ $< functions/common.go build: $(go_apps) clean: rm -rf ./bin deploy: sls deploy --verbose install: build deploy
Any help would be greatly appreciated
Update: I found this article that should help with migration
I'll report back when I've implemented it and ensures it works as intended
Update 2:
I was able to use SAM local to test my functions in the new AL2 runtime successfully with the help of this AWS sample AL2 implementation with Go. I moved my common.go file to a new repository and built a go module successfully with it (which was then imported to my functions). This is just a start as I have yet to deploy my functions via Serverless but this might be helpful to others in the meantime.