Skip to content
AWS Lambda with Serverless in Golang,
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
hello
slides
world Final Golang AWS Lambda Jan 24, 2019
.gitignore
Gopkg.lock
Gopkg.toml
Makefile
README.rst
package-lock.json
serverless.yml
template.yml

README.rst

Serverless Golang

Feedback? Questions? Do not hesitate to send me an email. Helpful? Give a LIKE to a LinkedIn post about this talk or a STAR to this github repo.

Golang AWS Lambda with Serverless and SAM

Hello-worder:

brew tap aws/tap
brew install aws-sam-cli
mkidr $GOPATH/github.com/wojciech12/planning-poker
cd $GOPATH/github.com/wojciech12/planning-poker
npm install -g serverless
serverless create -t aws-go-dep
 cat > template.yml <<EOF
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A hello world application.
Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: bin/hello
      Runtime: go1.x
      Events:
        Vote:
          Type: Api
          Properties:
            Path: /
            Method: get

EOF

Test locally:

sam local start-api
sam local start-api --env-vars env.json
sam local generate-event apigateway authorizer > event.json
sam local invoke "HelloWorldFunction" -e event.json
sam local generate-event apigateway authorize

see:

curl  http://127.0.0.1:3000/hello
curl  http://127.0.0.1:3000/hello/wojtek
curl  http://127.0.0.1:3000/hello?name=wojtek
python3 -m venv .venv
source .venv/bin/activate
pip install localstack

Related work

You can’t perform that action at this time.