<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nisarg-Satani</title>
    <description>The latest articles on Forem by Nisarg-Satani (@nisargsatani).</description>
    <link>https://forem.com/nisargsatani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F506328%2F490eaff0-c782-436d-9811-64d0823a3a8f.jpeg</url>
      <title>Forem: Nisarg-Satani</title>
      <link>https://forem.com/nisargsatani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nisargsatani"/>
    <language>en</language>
    <item>
      <title>Boost Your Website's User Experience: Redirect Non-WWW to WWW with CloudFront's Edge Function</title>
      <dc:creator>Nisarg-Satani</dc:creator>
      <pubDate>Wed, 29 Mar 2023 17:51:13 +0000</pubDate>
      <link>https://forem.com/nisargsatani/boost-your-websites-user-experience-redirect-non-www-to-www-with-cloudfronts-edge-function-ki9</link>
      <guid>https://forem.com/nisargsatani/boost-your-websites-user-experience-redirect-non-www-to-www-with-cloudfronts-edge-function-ki9</guid>
      <description>&lt;p&gt;As a website owner, it's essential to ensure that your visitors can easily access your website. One of the ways to achieve this is by redirecting your non-www website to your www website. This is a common practice that helps to improve the user experience and ensure consistency in your website's URL structure. In this blog post, we'll explore how to redirect a non-www website to a www website using CloudFront's Edge Function.&lt;/p&gt;

&lt;p&gt;Before we dive into the specifics of using CloudFront's Edge Function, let's first understand the concept of non-www and www URLs. A website URL can either start with www or not. For instance, &lt;a href="https://example.com"&gt;https://example.com&lt;/a&gt; is a non-www URL, while &lt;a href="https://www.example.com"&gt;https://www.example.com&lt;/a&gt; is a www URL. While both URLs can be used to access your website, it's best to choose one and stick with it. This helps to avoid duplicate content issues and makes it easier for search engines to crawl your website.&lt;/p&gt;

&lt;p&gt;Now that we understand the importance of redirecting a non-www website to a www website let's explore how to achieve this using CloudFront's Edge Function. CloudFront is a content delivery network (CDN) that enables you to distribute your content globally with low latency and high transfer speeds. Edge Functions, on the other hand, allow you to run JavaScript code at the edge locations of CloudFront, enabling you to modify the content served by your website.&lt;/p&gt;

&lt;p&gt;To redirect a non-www website to a www website using CloudFront's Edge Function, follow these steps:&lt;/p&gt;

&lt;p&gt;Step 1: Create an Edge Function&lt;/p&gt;

&lt;p&gt;The first step is to create an Edge Function in the AWS Management Console. To do this, navigate to the CloudFront console, select your distribution, and click on the "Behaviors" tab. Then, click on "Create Function" and select "Blank Function." Give your function a name and select the "Viewer Request" event type.&lt;/p&gt;

&lt;p&gt;Step 2: Write the Code&lt;/p&gt;

&lt;p&gt;Next, you need to write the code for the Edge Function. Here's an example of what the code might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handler(event) {
  var request = event.request;
  var headers = request.headers;
  var hostHeader = headers['host'][0].value;

  if (hostHeader.startsWith('example.com')) {
    var redirectUrl = 'https://www.example.com' + request.uri;
    var response = {
      status: '301',
      statusDescription: 'Moved Permanently',
      headers: {
        location: [{
          key: 'Location',
          value: redirectUrl,
        }],
      },
    };
    return response;
  }
  return request;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code checks if the request is for the non-www website, and if it is, it creates a 301 redirect to the www website. It then returns the redirect response to the user's browser.&lt;/p&gt;

&lt;p&gt;Step 3: Save and Deploy&lt;/p&gt;

&lt;p&gt;Once you've written the code, save the Edge Function and deploy it to your CloudFront distribution. You can do this by clicking on the "Deploy" button in the CloudFront console.&lt;/p&gt;

&lt;p&gt;That's it! You've now successfully redirected your non-www website to your www website using CloudFront's Edge Function.&lt;/p&gt;

&lt;p&gt;In conclusion, redirecting your non-www website to your www website is a simple but essential step in improving the user experience and ensuring consistency in your website's URL structure. Using CloudFront's Edge Function makes this process even easier, and you can do it in just a few simple steps.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>devops</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Configuring S3 bucket with lambda function, lambda function with SQS</title>
      <dc:creator>Nisarg-Satani</dc:creator>
      <pubDate>Fri, 04 Jun 2021 09:13:01 +0000</pubDate>
      <link>https://forem.com/nisargsatani/configuring-s3-bucket-with-lambda-function-lambda-function-with-sqs-1m86</link>
      <guid>https://forem.com/nisargsatani/configuring-s3-bucket-with-lambda-function-lambda-function-with-sqs-1m86</guid>
      <description>&lt;p&gt;Hola Developers, Cloud Enthusiasts!!&lt;/p&gt;

&lt;p&gt;The most important reason to write this is to help others, because this is not available anywhere if you find it.&lt;/p&gt;

&lt;p&gt;In my first summer internship we are working on a Document management system designed using serverless architecture. In this project I was assigned this task of sending notifications of S3 bucket to SQS using a lambda function.&lt;/p&gt;

&lt;p&gt;So let's get started.&lt;/p&gt;

&lt;p&gt;Step1: First make a bucket no need to do anything else in that just simply make a bucket with standard storage.&lt;/p&gt;

&lt;p&gt;Step2: Now go to Lambda function in services, and click on create a function. Following picture will make you understand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pdb3pxpA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho41xgoq50ggca1o90wx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pdb3pxpA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho41xgoq50ggca1o90wx.png" alt="Creating lambda function"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Create a lambda function by clicking on &lt;strong&gt;Create a function&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;Step 4: It will show you the following page&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cvOYeCWM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pifp0yfp0svejnle70ft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cvOYeCWM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pifp0yfp0svejnle70ft.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this select &lt;strong&gt;Author from scratch&lt;/strong&gt; than move down where you will see the following&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h1if-W1h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nma5r6f1zkttktl69zdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h1if-W1h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nma5r6f1zkttktl69zdd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here give your function a name of your choice and then select a language under &lt;strong&gt;Runtime&lt;/strong&gt; , preferably python.&lt;/p&gt;

&lt;p&gt;Then under &lt;strong&gt;Permissions&lt;/strong&gt; Choose or create an execution role. Here you will get 3 options as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N2HW37vG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nxhoj1ent6scq93pyo3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N2HW37vG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7nxhoj1ent6scq93pyo3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 5: For that go to IAM dashboard shown in the following picture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lyrn56Ed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxcdok4odv60k96oj6wn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lyrn56Ed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxcdok4odv60k96oj6wn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here now got to &lt;strong&gt;Roles&lt;/strong&gt; under &lt;strong&gt;Access management&lt;/strong&gt; after that create a role as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XbvX9j_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mk78pa53tx937bsi43kh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XbvX9j_k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mk78pa53tx937bsi43kh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In create role it will ask you to choose a use case in that select lambda.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JvD0NfRv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyvw7ar3c5vhva411gae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JvD0NfRv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyvw7ar3c5vhva411gae.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Than click next which will for permissions.&lt;/p&gt;

&lt;p&gt;Allow for the following policies for the services to be in a sync.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--klXwSJaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q9ki103pvwl81134tspw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--klXwSJaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q9ki103pvwl81134tspw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SQS Full access to write the message in the message queue.&lt;/p&gt;

&lt;p&gt;S3 Full access to get the notification in lambda which will give to SQS.&lt;/p&gt;

&lt;p&gt;CloudWatch Full access to watch the logs, by default logs of lambda are shown in CloudWatch but when these are integrated it is necessary to attach this policy.&lt;/p&gt;

&lt;p&gt;AWSLambdaSQSQueueExecutionRole to send data from lambda to SQS.&lt;/p&gt;

&lt;p&gt;After assigning these policies go next for tags they are optional, then go for review. Then give the name of this role as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PzD3QMxw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9k2tbggqegd3f9udr0j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PzD3QMxw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9k2tbggqegd3f9udr0j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this click &lt;strong&gt;Create role&lt;/strong&gt; and the role is created.&lt;/p&gt;

&lt;p&gt;Step 6: Go back to the lambda dashboard and select &lt;strong&gt;Select an existing role&lt;/strong&gt; which was made in IAM.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BdbnwV4k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ao4ea23l6es4l43f2vzp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BdbnwV4k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ao4ea23l6es4l43f2vzp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As shown below after selecting Selecting an existing role a dropdown box will appear and select the role which was created in IAM.&lt;/p&gt;

&lt;p&gt;After that &lt;strong&gt;Create function&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Step 7 : It will show like this as shown below, function name under &lt;strong&gt;Configuration under Designer&lt;/strong&gt; dropdown it will show these configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fmMYzxHF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zfeskgf7fmhet7fo0gs1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fmMYzxHF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zfeskgf7fmhet7fo0gs1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now add the trigger by clicking on the button on the left, can be shown in the above picture.&lt;/p&gt;

&lt;p&gt;In the Add &lt;strong&gt;trigger&lt;/strong&gt; give S3 and choose the bucket name which was created and under Event type dropdown select put, which means whenever an object is uploaded to the object it will trigger the lambda function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a9eEr-66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xd4imhfiyi5jglyuxhg6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a9eEr-66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xd4imhfiyi5jglyuxhg6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then &lt;strong&gt;Add&lt;/strong&gt; these triggers to the lambda function. After adding these trigger to the function dashboard will look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4OSZO9es--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fbx2esixjpwuvywc2yz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4OSZO9es--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fbx2esixjpwuvywc2yz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 8: Add the destination which is SQS.&lt;/p&gt;

&lt;p&gt;For that click on &lt;strong&gt;Add destination&lt;/strong&gt;, in which configure the destination.&lt;/p&gt;

&lt;p&gt;Select source as &lt;strong&gt;Asynchronous invocation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Select condition on which condition lambda will throw it to destination, so select &lt;strong&gt;On success&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After that select &lt;strong&gt;Destination type&lt;/strong&gt;, under dropdown select SQS queue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e8IdJpRU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jg234q49wmw96dfq9tzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e8IdJpRU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jg234q49wmw96dfq9tzu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that select destination, for that navigate to SQS queue dashboard.&lt;/p&gt;

&lt;p&gt;Make a queue for receiving messages from lambda.&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Create New queue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bd4gYj7U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6owrq92gixlckood8mat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bd4gYj7U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6owrq92gixlckood8mat.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that give the name of queue, and keep the queue type as &lt;strong&gt;Standard queue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k8UHgZQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtl524nm1ofd34sb97rt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k8UHgZQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtl524nm1ofd34sb97rt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down and click on &lt;strong&gt;Quick Create-queue&lt;/strong&gt; and the queue is ready for receiving messages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MQzFxMkZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5ympm6sh8f3q0zgdygt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MQzFxMkZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c5ympm6sh8f3q0zgdygt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Go back to lambda dashboard&lt;/strong&gt; and in the Destination Selection select the name of the queue which was created. As shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I0kiUiUe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc4wxhz1i3fipz79779x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I0kiUiUe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc4wxhz1i3fipz79779x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now Save the destination and the lambda dashboard will look like these.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xhQHMEpN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9eyyvcsz8k9qc8lhp8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xhQHMEpN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9eyyvcsz8k9qc8lhp8r.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now select the lambda function and scroll down where there will a &lt;strong&gt;Function code&lt;/strong&gt; window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CRyIbwfS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbdqr6k0vpt51hgq3cyd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CRyIbwfS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbdqr6k0vpt51hgq3cyd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any changes can be made in the &lt;strong&gt;return&lt;/strong&gt; part of the code.Now &lt;strong&gt;Save&lt;/strong&gt; and &lt;strong&gt;Test&lt;/strong&gt; the function.&lt;/p&gt;

&lt;p&gt;Below it will show the execution result as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2qA0KXlv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skr3ui4n2e4uybgm9ued.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2qA0KXlv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skr3ui4n2e4uybgm9ued.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 9: Now add a file to the S3 bucket and check the SQS queue for messages.&lt;/p&gt;

&lt;p&gt;For doing that upload a file to S3 bucket and navigate to the SQS dashboard and refresh it will show you the file uploaded and time stamp, file name, date of which the file was uploaded.&lt;/p&gt;

&lt;p&gt;Go in &lt;strong&gt;Queue Actions&lt;/strong&gt; dropdown and select View/Delete messages and start polling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bdvqdqR9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/104qjpzzjbwcjw0eqhto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bdvqdqR9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/104qjpzzjbwcjw0eqhto.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that it will show you the message as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1sEWG1iS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06njtlc89hitgog84eos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1sEWG1iS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06njtlc89hitgog84eos.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how you configure S3-Lambda-SQS.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>cloud</category>
      <category>serverless</category>
    </item>
  </channel>
</rss>
