diff --git a/Makefile b/Makefile index 3d6088e..cdee7f6 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,10 @@ SHELL := /bin/bash # https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html#examples-makefile-identifier # https://docs.aws.amazon.com/lambda/latest/dg/golang-package.html # https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2 +# https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/ build-Function: - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" \ - -o $(ARTIFACTS_DIR)/elistman-lambda lambda/main.go + GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-s -w" \ + -tags lambda.norpc -o $(ARTIFACTS_DIR)/bootstrap lambda/main.go static-checks: go vet -tags=all_tests ./... diff --git a/template.yml b/template.yml index 2f51d40..e3085ba 100644 --- a/template.yml +++ b/template.yml @@ -55,8 +55,11 @@ Resources: BuildMethod: makefile DependsOn: FunctionLogs Properties: - Handler: elistman-lambda - Runtime: go1.x + Handler: bootstrap + # https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/ + Runtime: provided.al2 + Architectures: + - "arm64" Description: Coordinates between the API Gateway, DynamoDB, SES, and SNS Timeout: 300 FunctionName: !Sub "${AWS::StackName}-function"