Skip to content
Open
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
6 changes: 6 additions & 0 deletions samples_1/go-lambda/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.PHONY: build

build:
@echo "Building..."
GOOS=linux go build -o bootstrap main.go
@echo "Build complete."
6 changes: 2 additions & 4 deletions samples_1/go-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ This is a very simple Hello World application written in Golang.

### Instructions

1. Build the binary to be compatible with Linux: `GOOS=linux go build main.go`
2. Zip up the binary: `zip main.zip ./main`
3. Invoke locally
1. Build the binary to be compatible with Linux: `make build`
2. Invoke locally
```bash
$ echo '"world"' | sam local invoke

Expand All @@ -15,4 +14,3 @@ $ echo '"world"' | sam local invoke
"Hello world!"

```

Binary file added samples_1/go-lambda/bootstrap
Binary file not shown.
5 changes: 5 additions & 0 deletions samples_1/go-lambda/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module test

go 1.22

require github.com/aws/aws-lambda-go v1.47.0
10 changes: 10 additions & 0 deletions samples_1/go-lambda/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI=
github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Binary file added samples_1/go-lambda/main
Binary file not shown.
11 changes: 5 additions & 6 deletions samples_1/go-lambda/template.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
AWSTemplateFormatVersion : '2010-09-09'
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: Hello World Go Lambda function
Description: Hello World Go Lambda function

Resources:

Function:
Type: AWS::Serverless::Function
Properties:
Handler: main
CodeUri: ./main.zip
Runtime: go1.x
Handler: bootstrap
CodeUri: ./
Runtime: provided.al2023