Create a Lambda function that publishes to an SQS queue
This Serverless Framework project deploys a Lambda function, an SQS queue and the IAM permissions required to run the application. The Lambda function publishes a message to the SQS queue when invoked.
Use the AWS CLI to invoke the Lambda function. The function name is in the outputs of the AWS SAM deployment (the key is QueuePublisherFunction):
1. Invoke the Lambda function to publish a message to the SQS queue: aws lambda invoke --function-name ENTER_YOUR_FUNCTION_NAME outfile.txt.
2. Retrieve the message from the SQS queue, using the queue URL from the AWS SAM deployment outputs: aws sqs receive-message --queue-url ENTER_YOUR_QUEUE_URL
Cleanup
1. Delete the stack: serverless remove.
2. Confirm the stack has been deleted: serverless info