[{"data":1,"prerenderedAt":65},["ShallowReactive",2],{"content-guides-serverless-crossplane-on-eks-testing":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":11,"contributorPaths":12,"menuType":14,"contentName":15,"slug":16,"readingTime":17,"menu":18,"nextDocItem":57,"previousDocItem":44},"\u003Cp>In this module we will test the serverless application by sending a message to the newly created SQS queue so we can observe it triggering the Lambda function and publishing the result into the S3 bucket.\u003C\u002Fp>\n\u003Ch2>Implementation\u003C\u002Fh2>\n\u003Cp>Use the following command to get the SQS URL and store it in $SQS_URL environment variable\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-sh\">SQS_URL=$(aws sqs list-queues --output json | jq -r &#39;.QueueUrls|map(select(contains(&quot;test-sqs-lambda-s3&quot;))) | .[0]&#39; | tr -d &#39;[:space:]&#39;)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>The command will only store the first url that contains test-sqs-lambda-s3 in the name. Validate you have the correct url:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-sh\">echo $SQS_URL\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Send a message to the queue.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-sh\">aws sqs send-message --queue-url $SQS_URL --message-body abc\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Or send 100 messages to the queue.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-sh\">for i in {1..100}; do aws sqs send-message --queue-url $SQS_URL --message-body abc ; done\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Navigate to the AWS console and observe the SQS triggering the Lambda, and publishing the result in the S3 bucket.\u003C\u002Fp>\n\u003Ch2>Conclusion\u003C\u002Fh2>\n\u003Cp>In this module, we tested the serverless application by sending messages to the SQS queue to verify that it triggers the Lambda function and publishes the result to the S3 bucket.\u003C\u002Fp>\n",{"title":6,"order":7,"learningGoals":8},"3. Test",2,[9,10],"Pushing messages to SQS using the AWS CLI.","Exploring the AWS SQS, Lambda, and S3 consoles.","In this module we will test the serverless application by sending a message to the newly created SQS queue so we can observe it triggering the Lambda function and publishing the result into the S3 bucket.\n\n## Implementation\n\nUse the following command to get the SQS URL and store it in $SQS_URL environment variable\n\n```sh\nSQS_URL=$(aws sqs list-queues --output json | jq -r '.QueueUrls|map(select(contains(\"test-sqs-lambda-s3\"))) | .[0]' | tr -d '[:space:]')\n```\n\nThe command will only store the first url that contains test-sqs-lambda-s3 in the name. Validate you have the correct url:\n\n```sh\necho $SQS_URL\n```\n\nSend a message to the queue.\n\n```sh\naws sqs send-message --queue-url $SQS_URL --message-body abc\n```\n\nOr send 100 messages to the queue.\n\n```sh\nfor i in {1..100}; do aws sqs send-message --queue-url $SQS_URL --message-body abc ; done\n```\n\nNavigate to the AWS console and observe the SQS triggering the Lambda, and publishing the result in the S3 bucket.\n\n## Conclusion\n\nIn this module, we tested the serverless application by sending messages to the SQS queue to verify that it triggers the Lambda function and publishes the result to the S3 bucket.",[13],"content\u002Fcontributors\u002Fdavid-boyne.json","LIST","Deploy a Serverless Application using Crossplane on EKS","\u002Fcontent\u002Fguides\u002Fserverless-crossplane-on-eks\u002Ftesting","1 min",[19,33],{"title":20,"content":21},"Introduction",[22],{"title":23,"order":24,"learningGoals":25,"time":29,"path":30,"id":31,"link":32},"Overview",1,[26,27,28],"Create a Docker image and push it to ECR.","Set Crossplane underlying Compositions and XRDs, and use Claims.","Validate results with basic commands using kubectl and the AWS CLI.","2 min","introduction","introduction.md","\u002Fcontent\u002Fguides\u002Fserverless-crossplane-on-eks\u002Fintroduction",{"title":34,"content":35},"Modules",[36,44,53,57],{"title":37,"order":7,"learningGoals":38,"time":29,"path":41,"id":42,"link":43},"1. Build a docker image and push to ECR",[39,40],"Building a Docker image from a given application","Creating an ECR repo and uploading an image to it using the AWS CLI","docker-image","docker-image.md","\u002Fcontent\u002Fguides\u002Fserverless-crossplane-on-eks\u002Fdocker-image",{"title":45,"order":7,"learningGoals":46,"time":49,"path":50,"id":51,"link":52},"2. Deploy the serverless application",[47,48],"Deploying Crossplane XRDs and Compositions","Deploying a Claim to create serverless application","3 min","deployment","deployment.md","\u002Fcontent\u002Fguides\u002Fserverless-crossplane-on-eks\u002Fdeployment",{"title":6,"order":7,"learningGoals":54,"time":17,"path":55,"id":56,"link":16},[9,10],"testing","testing.md",{"title":58,"order":7,"learningGoals":59,"time":17,"path":62,"id":63,"link":64},"4. Clean up resources",[60,61],"How to remove Crossplane resources","How to destroy EKS cluster if created using the GitHub repository.","cleanup","cleanup.md","\u002Fcontent\u002Fguides\u002Fserverless-crossplane-on-eks\u002Fcleanup",1792578866319]