From cbe42f4f9d17ce78645f70f206269ef6ba2b9e47 Mon Sep 17 00:00:00 2001 From: Yogesh Nain Date: Sun, 23 Feb 2025 11:13:38 +0000 Subject: [PATCH 01/10] Cloudformation Template that deploy REST API having backend integration to AWS SQS to receive Message from the queue. --- APIGateway-SQS-ReceiveMessages/README.md | 81 +++++++++++ .../example-pattern.json | 59 ++++++++ APIGateway-SQS-ReceiveMessages/src/app.js | 10 ++ APIGateway-SQS-ReceiveMessages/template.yaml | 127 ++++++++++++++++++ 4 files changed, 277 insertions(+) create mode 100644 APIGateway-SQS-ReceiveMessages/README.md create mode 100644 APIGateway-SQS-ReceiveMessages/example-pattern.json create mode 100644 APIGateway-SQS-ReceiveMessages/src/app.js create mode 100644 APIGateway-SQS-ReceiveMessages/template.yaml diff --git a/APIGateway-SQS-ReceiveMessages/README.md b/APIGateway-SQS-ReceiveMessages/README.md new file mode 100644 index 000000000..c7e085cb7 --- /dev/null +++ b/APIGateway-SQS-ReceiveMessages/README.md @@ -0,0 +1,81 @@ +# AWS API Gateway to AWS SQS + +This pattern creates REST API Gateway that directly integrate with AWS SQS. + +Learn more about this pattern at Serverless Land Patterns: << Add the live URL here >> + +Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. + +## Requirements + +* [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources. +* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured +* [Git Installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +* [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed + +## Deployment Instructions + +1. Create a new directory, navigate to that directory in a terminal and clone the GitHub repository: + ``` + git clone https://github.com/aws-samples/serverless-patterns + ``` +1. Change directory to the pattern directory: + ``` + cd _patterns-model + ``` +1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file: + ``` + sam deploy --guided + ``` +1. During the prompts: + * Enter a stack name + * Enter the desired AWS Region + * Allow SAM CLI to create IAM roles with the required permissions. + + Once you have run `sam deploy --guided` mode once and saved arguments to a configuration file (samconfig.toml), you can use `sam deploy` in future to use these defaults. + +1. Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs which are used for testing. + +## How it works + +This pattern creates an Amazon API gateway REST API endpoint. The endpoint uses service integrations to directly connect to Amazon SQS that reads messages from the SQS. +Users can simply call the GET Method of invoke URL( API Gateway) that is returned as part of the Stack Output. +Invoke URL can also be used with query string parameters like MaxNumberOfMessages=5 VisibilityTimeout=15 AttributeName=All to get the desired output. + +## Testing + +Sending a new test message to API Gateway endpoint + +To test the endpoint first send data using the following command. Be sure to update the endpoint with endpoint of your stack. +``` +curl --location --request GET 'ApiEndpoint output value' +``` +OR +``` +curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All' +``` + +## Expected Output: + +``` +{"ReceiveMessageResponse":{"ReceiveMessageResult":{"messages":null},"ResponseMetadata":{"RequestId":"RequestId"}}} +``` + +``` +{"ReceiveMessageResponse":{"ReceiveMessageResult":{"messages":[{"Attributes":null,"Body":"messageBody","MD5OfBody":"MD5OfBody","MD5OfMessageAttributes":null,"MessageAttributes":null,"MessageId":"Queue Message ID","ReceiptHandle":"ReceiptHandle"}]},"ResponseMetadata":{"RequestId":"requestID"}}} +``` + +## Cleanup + +1. Delete the stack + ```bash + aws cloudformation delete-stack --stack-name STACK_NAME + ``` +1. Confirm the stack has been deleted + ```bash + aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus" + ``` +---- +Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +SPDX-License-Identifier: MIT-0 diff --git a/APIGateway-SQS-ReceiveMessages/example-pattern.json b/APIGateway-SQS-ReceiveMessages/example-pattern.json new file mode 100644 index 000000000..b7012bdfa --- /dev/null +++ b/APIGateway-SQS-ReceiveMessages/example-pattern.json @@ -0,0 +1,59 @@ +{ + "title": "Step Functions to Athena", + "description": "Create a Step Functions workflow to query Amazon Athena.", + "language": "Python", + "level": "200", + "framework": "CDK", + "introBox": { + "headline": "How it works", + "text": [ + "This sample project demonstrates how to use an AWS Step Functions state machine to query Athena and get the results. This pattern is leveraging the native integration between these 2 services which means only JSON-based, structured language is used to define the implementation.", + "With Amazon Athena you can get up to 1000 results per invocation of the GetQueryResults method and this is the reason why the Step Function has a loop to get more results. The results are sent to a Map which can be configured to handle (the DoSomething state) the items in parallel or one by one by modifying the max_concurrency parameter.", + "This pattern deploys one Step Functions, two S3 Buckets, one Glue table and one Glue database." + ] + }, + "gitHub": { + "template": { + "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/sfn-athena-cdk-python", + "templateURL": "serverless-patterns/sfn-athena-cdk-python", + "projectFolder": "sfn-athena-cdk-python", + "templateFile": "sfn_athena_cdk_python_stack.py" + } + }, + "resources": { + "bullets": [ + { + "text": "Call Athena with Step Functions", + "link": "https://docs.aws.amazon.com/step-functions/latest/dg/connect-athena.html" + }, + { + "text": "Amazon Athena - Serverless Interactive Query Service", + "link": "https://aws.amazon.com/athena/" + } + ] + }, + "deploy": { + "text": [ + "sam deploy" + ] + }, + "testing": { + "text": [ + "See the GitHub repo for detailed testing instructions." + ] + }, + "cleanup": { + "text": [ + "Delete the stack: cdk delete." + ] + }, + "authors": [ + { + "name": "Your name", + "image": "link-to-your-photo.jpg", + "bio": "Your bio.", + "linkedin": "linked-in-ID", + "twitter": "twitter-handle" + } + ] +} diff --git a/APIGateway-SQS-ReceiveMessages/src/app.js b/APIGateway-SQS-ReceiveMessages/src/app.js new file mode 100644 index 000000000..cb3c4d9c1 --- /dev/null +++ b/APIGateway-SQS-ReceiveMessages/src/app.js @@ -0,0 +1,10 @@ +/*! Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +'use strict' + +exports.handler = async (event) => { + // Lambda handler code + console.log(JSON.stringify(event, 0, null)) +} \ No newline at end of file diff --git a/APIGateway-SQS-ReceiveMessages/template.yaml b/APIGateway-SQS-ReceiveMessages/template.yaml new file mode 100644 index 000000000..801fd5b19 --- /dev/null +++ b/APIGateway-SQS-ReceiveMessages/template.yaml @@ -0,0 +1,127 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: 'REST API Gateway integration to get messages from SQS (tag: + apigw-sqs-rest, ReceiveMessage)' + +Resources: + # API Gateway + AppApi: + Type: AWS::ApiGateway::RestApi + Properties: + Name: apigw-rest-api-http-integration + Description: REST API Integration with SQS + + # GET Method with POST AWS Service integration to SQS + RootMethodGet: + Type: AWS::ApiGateway::Method + Properties: + RestApiId: !Ref AppApi + ResourceId: !GetAtt AppApi.RootResourceId + HttpMethod: GET + AuthorizationType: NONE + RequestParameters: + method.request.querystring.VisibilityTimeout: false + method.request.querystring.WaitTimeSeconds: false + method.request.querystring.MaxNumberOfMessages: false + method.request.querystring.AttributeName: false + Integration: + Credentials: !GetAtt APISQSGatewayRole.Arn + IntegrationHttpMethod: POST + IntegrationResponses: + - StatusCode: '200' + PassthroughBehavior: WHEN_NO_TEMPLATES + RequestParameters: + integration.request.header.Content-Type: '''application/x-www-form-urlencoded''' + integration.request.querystring.Action: '''ReceiveMessage''' + integration.request.querystring.AttributeName: method.request.querystring.AttributeName + integration.request.querystring.MaxNumberOfMessages: method.request.querystring.MaxNumberOfMessages + integration.request.querystring.VisibilityTimeout: method.request.querystring.VisibilityTimeout + integration.request.querystring.WaitTimeSeconds: method.request.querystring.WaitTimeSeconds + Type: AWS + Uri: !Join + - '' + - - 'arn:aws:apigateway:' + - !Ref AWS::Region + - ':sqs:path/' + - !Ref AWS::AccountId + - / + - !Sub ${MySqsQueue.QueueName} + MethodResponses: + - ResponseModels: + application/json: Empty + StatusCode: '200' + Deployment: + Type: AWS::ApiGateway::Deployment + DependsOn: + - RootMethodGet + Properties: + RestApiId: !Ref AppApi + + Stage: + Type: AWS::ApiGateway::Stage + Properties: + StageName: Prod + RestApiId: !Ref AppApi + DeploymentId: !Ref Deployment + + # SQS Queue + + MySqsQueue: + Type: AWS::SQS::Queue + + OrderServiceQueuePolicy: + Type: AWS::SQS::QueuePolicy + Properties: + Queues: + - !Ref MySqsQueue + PolicyDocument: + Version: '2012-10-17' + Statement: + - Sid: order-api-send-msg-sqs + Effect: Allow + Principal: + Service: apigateway.amazonaws.com + Action: + - SQS:ReceiveMessage + Resource: !GetAtt MySqsQueue.Arn + + + # Roles + + APISQSGatewayRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Principal: + Service: + - apigateway.amazonaws.com + Action: + - sts:AssumeRole + Policies: + - PolicyName: ApiGatewayLogsPolicy + PolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Action: + - sqs:ReceiveMessage + Resource: + - !GetAtt MySqsQueue.Arn + +Outputs: + # API Gateway Invoke URL + AppApiEndpoint: + Description: API Endpoint + Value: !Sub https://${AppApi}.execute-api.${AWS::Region}.amazonaws.com/Prod + + QueueName: + Description: SQS Name + Value: !Sub ${MySqsQueue.QueueName} + + QueueURL: + Description: SQS Queue URL + Value: !Ref MySqsQueue + From 6a00d419dcb36a90257b8ed50f02a8d0bed82332 Mon Sep 17 00:00:00 2001 From: Yogesh Nain Date: Sun, 23 Feb 2025 12:33:46 +0000 Subject: [PATCH 02/10] Cloudformation Template that deploy REST API having backend integration to AWS SQS to receive Message from the queue. --- .../example-pattern.json | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/APIGateway-SQS-ReceiveMessages/example-pattern.json b/APIGateway-SQS-ReceiveMessages/example-pattern.json index b7012bdfa..89cce38fa 100644 --- a/APIGateway-SQS-ReceiveMessages/example-pattern.json +++ b/APIGateway-SQS-ReceiveMessages/example-pattern.json @@ -1,34 +1,38 @@ { - "title": "Step Functions to Athena", - "description": "Create a Step Functions workflow to query Amazon Athena.", + "title": "APIGateway-SQS-ReceiveMessages", + "description": "Create a REST API Gateway to receive Messages from SQS queue.", "language": "Python", "level": "200", - "framework": "CDK", + "framework": "SAM", "introBox": { "headline": "How it works", "text": [ - "This sample project demonstrates how to use an AWS Step Functions state machine to query Athena and get the results. This pattern is leveraging the native integration between these 2 services which means only JSON-based, structured language is used to define the implementation.", - "With Amazon Athena you can get up to 1000 results per invocation of the GetQueryResults method and this is the reason why the Step Function has a loop to get more results. The results are sent to a Map which can be configured to handle (the DoSomething state) the items in parallel or one by one by modifying the max_concurrency parameter.", - "This pattern deploys one Step Functions, two S3 Buckets, one Glue table and one Glue database." + "This pattern creates an Amazon API gateway REST API endpoint. The endpoint uses service integrations to directly connect to Amazon SQS that reads messages from the SQS.", + "Users can simply call the GET Method of invoke URL( API Gateway) that is returned as part of the Stack Output.", + "Invoke URL can also be used with query string parameters like MaxNumberOfMessages=5 VisibilityTimeout=15 AttributeName=All to get the desired output." ] }, "gitHub": { "template": { - "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/sfn-athena-cdk-python", - "templateURL": "serverless-patterns/sfn-athena-cdk-python", - "projectFolder": "sfn-athena-cdk-python", - "templateFile": "sfn_athena_cdk_python_stack.py" + "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/APIGateway-SQS-ReceiveMessages", + "templateURL": "serverless-patterns/APIGateway-SQS-ReceiveMessages", + "projectFolder": "APIGateway-SQS-ReceiveMessages", + "templateFile": "template.yaml" } }, "resources": { "bullets": [ { - "text": "Call Athena with Step Functions", - "link": "https://docs.aws.amazon.com/step-functions/latest/dg/connect-athena.html" + "text": "Working on integration of AWS Services with API Gateway", + "link": "https://repost.aws/knowledge-center/api-gateway-proxy-integrate-service" }, { - "text": "Amazon Athena - Serverless Interactive Query Service", - "link": "https://aws.amazon.com/athena/" + "text": "API Gateway Documentation", + "link": "https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html" + }, + { + "text":"AWS SQS Documentation", + "link":"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html" } ] }, @@ -44,16 +48,15 @@ }, "cleanup": { "text": [ - "Delete the stack: cdk delete." + "Delete the stack: sam delete" ] }, "authors": [ { - "name": "Your name", + "name": "Yogesh Nain", "image": "link-to-your-photo.jpg", - "bio": "Your bio.", - "linkedin": "linked-in-ID", - "twitter": "twitter-handle" + "bio": "Yogesh is Cloud Support Engineer and SME of Lambda, API Gateway at Amazon Web Services.", + "linkedin": "https://www.linkedin.com/in/yogesh-nain-a54133170/" } ] } From da85f41343cab36ab133a23e4e8b49bd42600461 Mon Sep 17 00:00:00 2001 From: Yogesh Nain Date: Fri, 28 Feb 2025 07:45:10 +0000 Subject: [PATCH 03/10] Cloudformation Template that deploy REST API having backend integration to AWS SQS to receive Message from the queue. --- APIGateway-SQS-ReceiveMessages/README.md | 30 +++++++++-- .../example-pattern.json | 12 ++++- .../send_message_to_queue.sh | 54 +++++++++++++++++++ 3 files changed, 90 insertions(+), 6 deletions(-) create mode 100755 APIGateway-SQS-ReceiveMessages/send_message_to_queue.sh diff --git a/APIGateway-SQS-ReceiveMessages/README.md b/APIGateway-SQS-ReceiveMessages/README.md index c7e085cb7..55c23011c 100644 --- a/APIGateway-SQS-ReceiveMessages/README.md +++ b/APIGateway-SQS-ReceiveMessages/README.md @@ -21,7 +21,7 @@ Important: this application uses various AWS services and there are costs associ ``` 1. Change directory to the pattern directory: ``` - cd _patterns-model + cd APIGateway-SQS-ReceiveMessages ``` 1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file: ``` @@ -42,25 +42,45 @@ This pattern creates an Amazon API gateway REST API endpoint. The endpoint uses Users can simply call the GET Method of invoke URL( API Gateway) that is returned as part of the Stack Output. Invoke URL can also be used with query string parameters like MaxNumberOfMessages=5 VisibilityTimeout=15 AttributeName=All to get the desired output. -## Testing +Usage and defination of each parameter can be found in [AWS API Reference Dcoumentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) + +## Usage Example and Consideration: +Useful with Frontend application that would like to interact with sqs via https protocol to read messages from the SQS queue +Avoid any useage of AWS SDK since request to SQS can be made via simple http request. + +Please also consider looking at [API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html) and [SQS Quotas](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html) for different limits supported by the services when working with this pattern. +## Testing +1. When Queue is Empty: Sending a new test message to API Gateway endpoint -To test the endpoint first send data using the following command. Be sure to update the endpoint with endpoint of your stack. +To test the endpoint first send HTTP request using the following command. Be sure to update the endpoint with endpoint of your stack. ``` curl --location --request GET 'ApiEndpoint output value' ``` OR + +2. When Queue has Messages: +To send messages to queue, Please use below commands: +Note: queueURL can be found as part of Stack Output. +``` +chmod +x send_message_to_queue.sh +./send_message_to_queue.sh {queueURL} {number of messages} +``` +Eg: ``` ./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3 ``` + +Now use below Command to get messages from the queue utilising MazNumberOfMessages, VisibilityTiemout and AtrributeName Parameters. Behaviour of each parameter can be found in [AWS API Reference Dcoumentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) + ``` curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All' ``` ## Expected Output: - +When Queue is Empty ``` {"ReceiveMessageResponse":{"ReceiveMessageResult":{"messages":null},"ResponseMetadata":{"RequestId":"RequestId"}}} ``` - +When Queue has Messages: ``` {"ReceiveMessageResponse":{"ReceiveMessageResult":{"messages":[{"Attributes":null,"Body":"messageBody","MD5OfBody":"MD5OfBody","MD5OfMessageAttributes":null,"MessageAttributes":null,"MessageId":"Queue Message ID","ReceiptHandle":"ReceiptHandle"}]},"ResponseMetadata":{"RequestId":"requestID"}}} ``` diff --git a/APIGateway-SQS-ReceiveMessages/example-pattern.json b/APIGateway-SQS-ReceiveMessages/example-pattern.json index 89cce38fa..018720d97 100644 --- a/APIGateway-SQS-ReceiveMessages/example-pattern.json +++ b/APIGateway-SQS-ReceiveMessages/example-pattern.json @@ -9,7 +9,9 @@ "text": [ "This pattern creates an Amazon API gateway REST API endpoint. The endpoint uses service integrations to directly connect to Amazon SQS that reads messages from the SQS.", "Users can simply call the GET Method of invoke URL( API Gateway) that is returned as part of the Stack Output.", - "Invoke URL can also be used with query string parameters like MaxNumberOfMessages=5 VisibilityTimeout=15 AttributeName=All to get the desired output." + "Invoke URL can also be used with query string parameters like MaxNumberOfMessages=5 VisibilityTimeout=15 AttributeName=All to get the desired output.", + "Useful with Frontend application that would like to interact with sqs via https protocol to read messages from the SQS queue Avoid any useage of AWS SDK since request to SQS can be made via simple http request.", + "Please also consider looking at AWS API Gateway and AWS SQS quotas for different limits supported by the services when working with this pattern." ] }, "gitHub": { @@ -33,6 +35,14 @@ { "text":"AWS SQS Documentation", "link":"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html" + }, + { + "text":"AWS API Gateway Quotas", + "link":"https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html" + }, + { + "text":"AWS SQS Quotas", + "link":"https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html" } ] }, diff --git a/APIGateway-SQS-ReceiveMessages/send_message_to_queue.sh b/APIGateway-SQS-ReceiveMessages/send_message_to_queue.sh new file mode 100755 index 000000000..3dd806dfa --- /dev/null +++ b/APIGateway-SQS-ReceiveMessages/send_message_to_queue.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Configuration +MESSAGE_PREFIX="Test message" +NUM_MESSAGES=5 +DELAY_SECONDS=0.1 + +# Color codes +RED='\033[0;31m' +GREEN='\033[0;32m' +NC='\033[0m' # No Color + +# Check if queue URL is provided +if [ -z "$1" ]; then + echo -e "${RED}Error:${NC} Queue URL is required" + echo -e "${GREEN}Usage:${NC} $0 [number-of-messages]" + exit 1 +fi + +QUEUE_URL="$1" + +# Check if number of messages is provided as second argument +if [ ! -z "$2" ]; then + NUM_MESSAGES=$2 +fi + +echo "Sending $NUM_MESSAGES messages to SQS queue: $QUEUE_URL" + +for i in $(seq 1 $NUM_MESSAGES) +do + MESSAGE="$MESSAGE_PREFIX #$i: This is the $i message sent at $(date '+%Y-%m-%d %H:%M:%S')" + + # Capture both stdout and stderr + output=$(aws sqs send-message \ + --queue-url "$QUEUE_URL" \ + --message-body "$MESSAGE" \ + --message-attributes "{ + \"SequenceNumber\": { + \"DataType\": \"Number\", + \"StringValue\": \"$i\" + } + }" 2>&1) + + # Check if command was successful + if [ $? -ne 0 ]; then + echo -e "${RED}Error:${NC} $output" + exit 1 + fi + + echo "Sent message $i" + sleep $DELAY_SECONDS +done + +echo "Completed sending $NUM_MESSAGES messages" + From 482bfbd145d1c1f32588571cbace5833fe5eecaf Mon Sep 17 00:00:00 2001 From: Yogesh Nain Date: Fri, 28 Feb 2025 07:57:18 +0000 Subject: [PATCH 04/10] Cloudformation Template that deploy REST API having backend integration to AWS SQS to receive Message from the queue. --- APIGateway-SQS-ReceiveMessages/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/APIGateway-SQS-ReceiveMessages/README.md b/APIGateway-SQS-ReceiveMessages/README.md index 55c23011c..d4e3ec120 100644 --- a/APIGateway-SQS-ReceiveMessages/README.md +++ b/APIGateway-SQS-ReceiveMessages/README.md @@ -62,6 +62,7 @@ OR 2. When Queue has Messages: To send messages to queue, Please use below commands: + Note: queueURL can be found as part of Stack Output. ``` chmod +x send_message_to_queue.sh @@ -69,7 +70,7 @@ chmod +x send_message_to_queue.sh ``` Eg: ``` ./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3 ``` -Now use below Command to get messages from the queue utilising MazNumberOfMessages, VisibilityTiemout and AtrributeName Parameters. Behaviour of each parameter can be found in [AWS API Reference Dcoumentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) +Now use below Command to get messages from the queue utilising MaxNumberOfMessages, VisibilityTimeout and AttributeName Parameters. Behaviour of each parameter can be found in [AWS API Reference Documentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) ``` curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All' From 0709aea0aebbedfe8737c6a1388ba3f87e0d00e3 Mon Sep 17 00:00:00 2001 From: Yogesh Nain Date: Tue, 4 Mar 2025 14:56:53 +0000 Subject: [PATCH 05/10] Made changes to README.md --- APIGateway-SQS-ReceiveMessages/README.md | 169 ++++++++++++----------- 1 file changed, 87 insertions(+), 82 deletions(-) diff --git a/APIGateway-SQS-ReceiveMessages/README.md b/APIGateway-SQS-ReceiveMessages/README.md index d4e3ec120..0c6003473 100644 --- a/APIGateway-SQS-ReceiveMessages/README.md +++ b/APIGateway-SQS-ReceiveMessages/README.md @@ -1,102 +1,107 @@ -# AWS API Gateway to AWS SQS - -This pattern creates REST API Gateway that directly integrate with AWS SQS. +## AWS API Gateway to AWS SQS +This pattern creates a REST API Gateway that directly integrates with AWS SQS to read messages. Learn more about this pattern at Serverless Land Patterns: << Add the live URL here >> - -Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. +Important: This application uses various AWS services that incur costs beyond the Free Tier usage. Please review the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. ## Requirements -* [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources. -* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured -* [Git Installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) -* [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed +- An [AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) with appropriate IAM permissions to make service calls and manage AWS resources +- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured +- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed +- [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed ## Deployment Instructions -1. Create a new directory, navigate to that directory in a terminal and clone the GitHub repository: - ``` - git clone https://github.com/aws-samples/serverless-patterns - ``` -1. Change directory to the pattern directory: - ``` - cd APIGateway-SQS-ReceiveMessages - ``` -1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file: - ``` - sam deploy --guided - ``` -1. During the prompts: - * Enter a stack name - * Enter the desired AWS Region - * Allow SAM CLI to create IAM roles with the required permissions. - - Once you have run `sam deploy --guided` mode once and saved arguments to a configuration file (samconfig.toml), you can use `sam deploy` in future to use these defaults. - -1. Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs which are used for testing. +1. Clone the GitHub repository: +```git clone https://github.com/aws-samples/serverless-patterns``` +2. Navigate to the pattern directory: +```cd APIGateway-SQS-ReceiveMessages``` +3. Deploy using AWS SAM: +```sam deploy --guided``` +During the prompts: + - Enter a stack name + - Select your desired AWS Region + - Allow SAM CLI to create IAM roles with required permissions + - After initial deployment with sam deploy --guided, subsequent deployments can use sam deploy with the saved configuration (samconfig.toml). + - Note the outputs from the deployment process, as they contain resource names and/or ARNs needed for testing. ## How it works -This pattern creates an Amazon API gateway REST API endpoint. The endpoint uses service integrations to directly connect to Amazon SQS that reads messages from the SQS. -Users can simply call the GET Method of invoke URL( API Gateway) that is returned as part of the Stack Output. -Invoke URL can also be used with query string parameters like MaxNumberOfMessages=5 VisibilityTimeout=15 AttributeName=All to get the desired output. +This pattern creates an Amazon API Gateway REST API endpoint that directly connects to Amazon SQS using service integrations. Users can retrieve messages by calling the GET method of the invoke URL (API Gateway) provided in the Stack Output. +The invoke URL supports query string parameters such as MaxNumberOfMessages=5, VisibilityTimeout=15, and AttributeName=All to customize the response. +For detailed parameter definitions, refer to the [AWS API Reference Documentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html). -Usage and defination of each parameter can be found in [AWS API Reference Dcoumentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) +## Usage Example and Consideration -## Usage Example and Consideration: -Useful with Frontend application that would like to interact with sqs via https protocol to read messages from the SQS queue -Avoid any useage of AWS SDK since request to SQS can be made via simple http request. - -Please also consider looking at [API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html) and [SQS Quotas](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html) for different limits supported by the services when working with this pattern. +This pattern is ideal for scenarios where you need to retrieve messages from SQS via HTTPS without using AWS SDK. Common use cases include: +Web applications that need to poll SQS queues for new messages, Mobile applications requiring secure access to SQS messages, Third-party integrations where direct AWS SDK access isn't practical, Microservices architectures where services need to read messages over HTTP/HTTPS, Legacy system integrations that support only HTTP/HTTPS protocols, Development environments where simplified queue access is preferred +Please review [API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html) and [SQS Quotas](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html) for service limits before implementation. ## Testing -1. When Queue is Empty: -Sending a new test message to API Gateway endpoint - -To test the endpoint first send HTTP request using the following command. Be sure to update the endpoint with endpoint of your stack. -``` -curl --location --request GET 'ApiEndpoint output value' -``` -OR - -2. When Queue has Messages: -To send messages to queue, Please use below commands: - -Note: queueURL can be found as part of Stack Output. -``` -chmod +x send_message_to_queue.sh -./send_message_to_queue.sh {queueURL} {number of messages} -``` -Eg: ``` ./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3 ``` - -Now use below Command to get messages from the queue utilising MaxNumberOfMessages, VisibilityTimeout and AttributeName Parameters. Behaviour of each parameter can be found in [AWS API Reference Documentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) - -``` -curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All' -``` - -## Expected Output: -When Queue is Empty -``` -{"ReceiveMessageResponse":{"ReceiveMessageResult":{"messages":null},"ResponseMetadata":{"RequestId":"RequestId"}}} -``` + +Follow these steps to test the integration: +1. First, send test messages to the queue: +```chmod +x send_message_to_queue.sh``` +```./send_message_to_queue.sh {queueURL} {number of messages}``` +Example: +```./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3``` +2. Then, retrieve messages using the API Gateway endpoint: +Basic retrieval: +```curl --location --request GET '{ApiEndpoint output value}'``` +Advanced retrieval with parameters: +```curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All'``` +Parameter details are available in the [AWS API Reference Documentation]( +https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html +). + +Expected Output + +When Queue is Empty: +~~~ +{ + "ReceiveMessageResponse": { + "ReceiveMessageResult": { + "messages": null + }, + "ResponseMetadata": { + "RequestId": "RequestId" + } + } +} +~~~ When Queue has Messages: -``` -{"ReceiveMessageResponse":{"ReceiveMessageResult":{"messages":[{"Attributes":null,"Body":"messageBody","MD5OfBody":"MD5OfBody","MD5OfMessageAttributes":null,"MessageAttributes":null,"MessageId":"Queue Message ID","ReceiptHandle":"ReceiptHandle"}]},"ResponseMetadata":{"RequestId":"requestID"}}} -``` +~~~ +{ + "ReceiveMessageResponse": { + "ReceiveMessageResult": { + "messages": [ + { + "Attributes": null, + "Body": "messageBody", + "MD5OfBody": "MD5OfBody", + "MD5OfMessageAttributes": null, + "MessageAttributes": null, + "MessageId": "Queue Message ID", + "ReceiptHandle": "ReceiptHandle" + } + ] + }, + "ResponseMetadata": { + "RequestId": "requestID" + } + } +} +~~~ ## Cleanup - -1. Delete the stack - ```bash - aws cloudformation delete-stack --stack-name STACK_NAME - ``` -1. Confirm the stack has been deleted - ```bash - aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus" - ``` ----- -Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Delete the stack using SAM: +```sam delete``` +Confirm when prompted to delete the stack and its resources. + +Note: You can also use +```sam delete --no-prompts``` to skip confirmation steps. + +Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 From 69540ce92252d2f7a391517a53a8902ae07169e0 Mon Sep 17 00:00:00 2001 From: Manju Arakere <23362982+marakere@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:47:11 -0500 Subject: [PATCH 06/10] Update README.md --- APIGateway-SQS-ReceiveMessages/README.md | 53 ++++++++++++++++-------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/APIGateway-SQS-ReceiveMessages/README.md b/APIGateway-SQS-ReceiveMessages/README.md index 0c6003473..bd4dc6d8e 100644 --- a/APIGateway-SQS-ReceiveMessages/README.md +++ b/APIGateway-SQS-ReceiveMessages/README.md @@ -1,8 +1,9 @@ ## AWS API Gateway to AWS SQS This pattern creates a REST API Gateway that directly integrates with AWS SQS to read messages. -Learn more about this pattern at Serverless Land Patterns: << Add the live URL here >> -Important: This application uses various AWS services that incur costs beyond the Free Tier usage. Please review the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. +Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/ + +**Important**: This application uses various AWS services that incur costs beyond the Free Tier usage. Please review the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example. ## Requirements @@ -15,50 +16,63 @@ Important: This application uses various AWS services that incur costs beyond th 1. Clone the GitHub repository: ```git clone https://github.com/aws-samples/serverless-patterns``` + 2. Navigate to the pattern directory: ```cd APIGateway-SQS-ReceiveMessages``` + 3. Deploy using AWS SAM: ```sam deploy --guided``` + During the prompts: - Enter a stack name - Select your desired AWS Region - Allow SAM CLI to create IAM roles with required permissions - - After initial deployment with sam deploy --guided, subsequent deployments can use sam deploy with the saved configuration (samconfig.toml). - - Note the outputs from the deployment process, as they contain resource names and/or ARNs needed for testing. + +After initial deployment with sam deploy --guided, subsequent deployments can use sam deploy with the saved configuration (samconfig.toml). + +Note the outputs from the deployment process, as they contain resource names and/or ARNs needed for testing. ## How it works This pattern creates an Amazon API Gateway REST API endpoint that directly connects to Amazon SQS using service integrations. Users can retrieve messages by calling the GET method of the invoke URL (API Gateway) provided in the Stack Output. + The invoke URL supports query string parameters such as MaxNumberOfMessages=5, VisibilityTimeout=15, and AttributeName=All to customize the response. + For detailed parameter definitions, refer to the [AWS API Reference Documentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html). ## Usage Example and Consideration This pattern is ideal for scenarios where you need to retrieve messages from SQS via HTTPS without using AWS SDK. Common use cases include: -Web applications that need to poll SQS queues for new messages, Mobile applications requiring secure access to SQS messages, Third-party integrations where direct AWS SDK access isn't practical, Microservices architectures where services need to read messages over HTTP/HTTPS, Legacy system integrations that support only HTTP/HTTPS protocols, Development environments where simplified queue access is preferred +Web applications that need to poll SQS queues for new messages, Mobile applications requiring secure access to SQS messages, Third-party integrations where direct AWS SDK access isn't practical, Legacy system integrations that support only HTTP/HTTPS protocols, Development environments where simplified queue access is preferred. + Please review [API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html) and [SQS Quotas](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html) for service limits before implementation. ## Testing Follow these steps to test the integration: + 1. First, send test messages to the queue: -```chmod +x send_message_to_queue.sh``` -```./send_message_to_queue.sh {queueURL} {number of messages}``` + ```chmod +x send_message_to_queue.sh``` + ```./send_message_to_queue.sh {queueURL} {number of messages}``` + Example: ```./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3``` + 2. Then, retrieve messages using the API Gateway endpoint: + Basic retrieval: ```curl --location --request GET '{ApiEndpoint output value}'``` + Advanced retrieval with parameters: ```curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All'``` + Parameter details are available in the [AWS API Reference Documentation]( -https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html -). +https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html). -Expected Output +## Expected Output When Queue is Empty: -~~~ +```json { "ReceiveMessageResponse": { "ReceiveMessageResult": { @@ -69,9 +83,10 @@ When Queue is Empty: } } } -~~~ +``` + When Queue has Messages: -~~~ +```json { "ReceiveMessageResponse": { "ReceiveMessageResult": { @@ -92,16 +107,20 @@ When Queue has Messages: } } } -~~~ +``` ## Cleanup Delete the stack using SAM: -```sam delete``` +``` +sam delete +``` + Confirm when prompted to delete the stack and its resources. -Note: You can also use -```sam delete --no-prompts``` to skip confirmation steps. +Note: You can also use `sam delete --no-prompts` to skip confirmation steps. + +--- Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 From e84fe5c4fc3141514de0d8200a85dfc3dbe129e1 Mon Sep 17 00:00:00 2001 From: Manju Arakere <23362982+marakere@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:48:13 -0500 Subject: [PATCH 07/10] Update README.md --- APIGateway-SQS-ReceiveMessages/README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/APIGateway-SQS-ReceiveMessages/README.md b/APIGateway-SQS-ReceiveMessages/README.md index bd4dc6d8e..34c2e8ce1 100644 --- a/APIGateway-SQS-ReceiveMessages/README.md +++ b/APIGateway-SQS-ReceiveMessages/README.md @@ -53,21 +53,22 @@ Follow these steps to test the integration: 1. First, send test messages to the queue: ```chmod +x send_message_to_queue.sh``` + ```./send_message_to_queue.sh {queueURL} {number of messages}``` -Example: -```./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3``` + Example: + ```./send_message_to_queue.sh https://sqs.us-east-1.amazonaws.com/210987654321/myQueue 3``` 2. Then, retrieve messages using the API Gateway endpoint: -Basic retrieval: -```curl --location --request GET '{ApiEndpoint output value}'``` + Basic retrieval: + ```curl --location --request GET '{ApiEndpoint output value}'``` -Advanced retrieval with parameters: -```curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All'``` + Advanced retrieval with parameters: + ```curl --location --request GET '{ApiEndpoint output value}?MaxNumberOfMessages=5&VisibilityTimeout=15&AttributeName=All'``` -Parameter details are available in the [AWS API Reference Documentation]( -https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html). + Parameter details are available in the [AWS API Reference Documentation]( + https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html). ## Expected Output From c50d1df639701ce845b05c691e4fa317eed014d6 Mon Sep 17 00:00:00 2001 From: Manju Arakere <23362982+marakere@users.noreply.github.com> Date: Tue, 4 Mar 2025 12:05:52 -0500 Subject: [PATCH 08/10] Create apigateway-sqs-receiveMessages.json --- .../apigateway-sqs-receiveMessages.json | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 APIGateway-SQS-ReceiveMessages/apigateway-sqs-receiveMessages.json diff --git a/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receiveMessages.json b/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receiveMessages.json new file mode 100644 index 000000000..328e7d0a5 --- /dev/null +++ b/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receiveMessages.json @@ -0,0 +1,89 @@ +{ + "title": "APIGateway-SQS-ReceiveMessages", + "description": "Create a REST API Gateway to receive Messages from SQS queue.", + "language": "Python", + "level": "200", + "framework": "SAM", + "introBox": { + "headline": "How it works", + "text": [ + "This serverless pattern creates an Amazon API Gateway REST API endpoint that directly integrates with Amazon Simple Queue Service (SQS) to read messages from a queue.", + "Users can simply call the GET method of the invoke URL to interact with the SQS queue. The invoke URL supports query string parameters such as MaxNumberOfMessages, VisibilityTimeout, and AttributeName to customize the output.", + "This pattern is particularly useful for frontend applications that need to interact with SQS via HTTPS protocol to read messages from the queue. It eliminates the need for AWS SDK integration, as requests to SQS can be made through simple HTTP calls.When implementing this pattern, please consider the AWS API Gateway and AWS SQS quotas to ensure compliance with the service limits." + ] + }, + "gitHub": { + "template": { + "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/APIGateway-SQS-ReceiveMessages", + "templateURL": "serverless-patterns/APIGateway-SQS-ReceiveMessages", + "projectFolder": "APIGateway-SQS-ReceiveMessages", + "templateFile": "template.yaml" + } + }, + "resources": { + "bullets": [ + { + "text": "Working on integration of AWS Services with API Gateway", + "link": "https://repost.aws/knowledge-center/api-gateway-proxy-integrate-service" + }, + { + "text": "API Gateway Documentation", + "link": "https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html" + }, + { + "text": "AWS SQS Documentation", + "link": "https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html" + }, + { + "text": "AWS API Gateway Quotas", + "link": "https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html" + }, + { + "text": "AWS SQS Quotas", + "link": "https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html" + } + ] + }, + "deploy": { + "text": [ + "sam deploy" + ] + }, + "testing": { + "text": [ + "See the GitHub repo for detailed testing instructions." + ] + }, + "cleanup": { + "text": [ + "Delete the stack: sam delete" + ] + }, + "authors": [ + { + "name": "Yogesh Nain", + "image": "link-to-your-photo.jpg", + "bio": "Yogesh is Cloud Support Engineer and SME of Lambda, API Gateway at Amazon Web Services.", + "linkedin": "yogesh-nain-a54133170" + } + ], + "patternArch": { + "icon1": { + "x": 20, + "y": 50, + "service": "apigw", + "label": "API Gateway REST API" + }, + "icon2": { + "x": 80, + "y": 50, + "service": "sqs", + "label": "Amazon SQS" + }, + "line1": { + "from": "icon1", + "to": "icon2", + "label": "" + } + } +} From 120f59944339efbcfc7dd5f4d9480de2a17c89de Mon Sep 17 00:00:00 2001 From: Manju Arakere <23362982+marakere@users.noreply.github.com> Date: Tue, 4 Mar 2025 12:06:12 -0500 Subject: [PATCH 09/10] Rename apigateway-sqs-receiveMessages.json to apigateway-sqs-receivemessages.json --- ...s-receiveMessages.json => apigateway-sqs-receivemessages.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename APIGateway-SQS-ReceiveMessages/{apigateway-sqs-receiveMessages.json => apigateway-sqs-receivemessages.json} (100%) diff --git a/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receiveMessages.json b/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receivemessages.json similarity index 100% rename from APIGateway-SQS-ReceiveMessages/apigateway-sqs-receiveMessages.json rename to APIGateway-SQS-ReceiveMessages/apigateway-sqs-receivemessages.json From cc681c5f1a70fa3cefaa21c4051b4b093413b548 Mon Sep 17 00:00:00 2001 From: Manju Arakere <23362982+marakere@users.noreply.github.com> Date: Tue, 4 Mar 2025 12:09:10 -0500 Subject: [PATCH 10/10] Update apigateway-sqs-receivemessages.json --- .../apigateway-sqs-receivemessages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receivemessages.json b/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receivemessages.json index 328e7d0a5..ddce0f53d 100644 --- a/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receivemessages.json +++ b/APIGateway-SQS-ReceiveMessages/apigateway-sqs-receivemessages.json @@ -46,7 +46,7 @@ }, "deploy": { "text": [ - "sam deploy" + "sam deploy --guided" ] }, "testing": {