Giter VIP home page Giter VIP logo

lamda-testing's Introduction

lamda-testing

having issue with the incorrect binary or executable version, and you must ensure that you have compiled your Go function code specifically for the Linux environment, which is the runtime environment for AWS Lambda.

Go binaries compiled for macOS or Windows will not work in Lambda

Make sure you compile your Go code using the appropriate target architecture and operating system, such as GOOS=linux GOARCH=amd64 before creating the deployment package. for example GOOS=linux GOARCH=amd64 go build main.go

Getting Started

  • go mod tidy
  • GOARCH=amd64 GOOS=linux go build main.go
  • zip function.zip main
  • aws lambda create-function --function-name (attach func name without bracket) --runtime go1.x --role arn:aws:iam::"your account id":role/lambda-2 --handler main --zip-file fileb://function.zip (and most importantly you need to write the go version here also)
  • aws lambda invoke --function-name (your function name without bracket) --cli-binary-format raw-in-base64-out --payload '{"What is your name?": "kim", "How old are you?": "20"}' output.txt

So practically the output.txt will be created and it will output "{"Answer:":"kim is 20 years old!"}" in the situation here which is the determinant base on the output after my payload func here.

lamda-testing's People

Contributors

dudeiebot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.