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

AWS Lambda end of support for the Go 1.x runtime #108

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ clean:

LAMBDA_S3_BUCKET := buildkite-aws-stack-lox
LAMBDA_S3_BUCKET_PATH := /
export CGO_ENABLED := 0

ifdef BUILDKITE_BUILD_NUMBER
LD_FLAGS := -s -w -X version.Build=$(BUILDKITE_BUILD_NUMBER)
Expand All @@ -25,17 +26,18 @@ endif

build: handler.zip

handler.zip: lambda/handler
handler.zip: bootstrap
zip -9 -v -j $@ "$<"

lambda/handler: lambda/main.go
bootstrap: lambda/main.go
docker run \
--env GOCACHE=/go/cache \
--env CGO_ENABLED \
--user $(USER) \
--volume $(PWD):/app \
--workdir /app \
--rm golang:1.19 \
go build -ldflags="$(LD_FLAGS)" -buildvcs="$(BUILDVSC_FLAG)" -o lambda/handler ./lambda
go build -ldflags="$(LD_FLAGS)" -buildvcs="$(BUILDVSC_FLAG)" -tags lambda.norpc -o bootstrap ./lambda

lambda-sync: handler.zip
aws s3 sync \
Expand Down
6 changes: 4 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ Resources:
Role: !If [ CreateRole, !GetAtt ExecutionRole.Arn, !Ref AutoscalingLambdaExecutionRole ]
PermissionsBoundary: !If [ SetRolePermissionsBoundaryARN, !Ref RolePermissionsBoundaryARN, !Ref "AWS::NoValue" ]
Timeout: 120
Handler: handler
Runtime: go1.x
Handler: bootstrap
Runtime: provided.al2
Architectures:
- x86_64
MemorySize: 128
Environment:
Variables:
Expand Down