Skip to content

Commit

Permalink
Update to provided.al2 runtime (#16)
Browse files Browse the repository at this point in the history
Update the service runtime ahead of the deprecation of the go1.x runtime by
AWS.

* disable CGO during build to avoid glibc version mismatch

* rename the executable `bootstrap` and place it in the task root directory
  as required by the new runtime

Closes #15
  • Loading branch information
drocco007 committed Oct 15, 2023
1 parent f5756e3 commit e6193a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
build: export GOOS=linux
build:
go build -o bin/drain cmd/drain/main.go
@du -h bin/drain
GOOS=linux
GOARCH=amd64
CGO_ENABLED=0
export

build:
go build -tags lambda.norpc -o bootstrap cmd/drain/main.go
@du -h bootstrap

deploy: build
sls deploy -v

outdated-deps: ## get list of outdated direct dependencies
@go list -u -f '{{if and (.Update) (not .Indirect)}}{{.}}{{end}}' -m all
@go list -u -f '{{if and (.Update) (not .Indirect)}}{{.}}{{end}}' -m all
6 changes: 3 additions & 3 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package:

provider:
name: aws
runtime: go1.x
runtime: provided.al2
region: us-east-1
memorySize: 128
timeout: 900
Expand All @@ -26,12 +26,12 @@ provider:

functions:
main:
handler: bin/drain
handler: bootstrap
package:
exclude:
- ./**
include:
- ./bin/drain
- ./bootstrap
events:
- cloudwatchEvent:
event:
Expand Down

0 comments on commit e6193a0

Please sign in to comment.