Skip to content

Commit

Permalink
Merge pull request #108 from HugeIRL/lambda-runtime-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius authored Oct 12, 2023
2 parents 6f0da14 + 95cc87c commit 7127e08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
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

0 comments on commit 7127e08

Please sign in to comment.