sam init
sam build
sam deploy --guided --profile matsonlabs
curl https://<api-id>.execute-api.us-west-2.amazonaws.com/Prod/hello/
- watch the logs
sam logs --stack-name sam-java-demo --profile matsonlabs --region us-west-2 --tail
- Code changes for accepting a simple request param and echoing it back
- hot deploy/ sam sync/watch
sam sync --watch --profile matsonlabs --region us-west-2
- deploy again and watch the logs
- View the resources in the console
- Lambda > configuration
- Implement SQS message handler: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-example.html
- Add an sqs queue, ref events: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#sqs
- Create a queue and get its ARN
- Ref cft: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sqs-queue.html
- Where to get the Arn?: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html
- !GetAtt
- Let's not name the queue
- Post message to queue
- cli ref: https://docs.aws.amazon.com/cli/latest/reference/
aws sqs send-message --profile matsonlabs --queue-url "https://sqs.us-west-2.amazonaws.com/275416279984/sam-java-demo-GreetingMessageQueue-2qIboUSqqs1d" --region us-west-2 --message-body "hello"