Skip to content

Running AWS Serverless Application Model (SAM)

License

Notifications You must be signed in to change notification settings

oleksiivelychko/go-aws-sam

Repository files navigation

go-aws-sam

Running AWS Serverless Application Model (SAM).

⚠️ Run LocalStack and create MyQueue

aws sqs create-queue --queue-name MyQueue --endpoint-url http://localhost:4566 --profile localstack

📌 Run PutMessageApi function

  • build function and start local API
sam build PutMessageApi
sam local start-api --skip-pull-image
  • send request to invoke function
curl -X POST -d '{"queue":"000000000000/MyQueue"}' http://127.0.0.1:3000/api/put-message

📌 Run PutMessage function

sam build PutMessage
sam local invoke PutMessage -e events/event.json --skip-pull-image

📌 Run PopMessage function

sam build PopMessage
sam local generate-event sqs receive-message --body 'Hello, World!' | sam local invoke -e - PopMessage --skip-pull-image

📎 Create a new SAM configuration

sam init --runtime go1.x

SAM IDE configuration 🐞 Debugging SAM on Apple M1 has bug aws/aws-toolkit-jetbrains#3061

About

Running AWS Serverless Application Model (SAM)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published