Skip to content

Commit

Permalink
Website build
Browse files Browse the repository at this point in the history
  • Loading branch information
SarthakMakhija committed Jan 20, 2024
1 parent 6fce3e8 commit 55f6178
Show file tree
Hide file tree
Showing 24 changed files with 62 additions and 321 deletions.
6 changes: 3 additions & 3 deletions en/blog/aws_lambda_a_virtual_podcast/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
provides an easy-to-use test/mocking framework for developing Cloud applications. At this stage, their focus is primarily on supporting the AWS cloud stack.</p><p>LocalStack spins up various Cloud APIs on local machine including S3, lambda, DynamoDB and API Gateway. All you need to do is, <b>spin up LocalStack docker container</b>, <b>deploy your infra say Dynamo table or lambda function</b> within LocalStack and <b>connect to these services</b> running on local machine from within your code.</p><p><span style=color:#28a745>Me></span> Interesting. Does LocalStack support all AWS services?</p><p><span style=color:#e83e8c>Hernandez></span> No, it supports quite a few but definitely not all.</p><blockquote class=wp-block-quote><p>I am sure Unit testing with AWS Lambda function code is understood by all of us but what is good to know is <i>LocalStack</i> can be used for integration testing.</p></blockquote><p style=text-align:center><strong>. . .</strong></p><h3 id=packaging-and-deploying-an-aws-lambda-application>Packaging and deploying an AWS Lambda application</h3><p><span style=color:#28a745>Me></span> Jessica, you talked about unzipped code. Does that mean you have to create a zip file and upload it somewhere?</p><p><span style=color:#f78c6c>Jessica></span> Well, you have package your lambda function along with its dependencies as an archive, upload it either on AWS Lambda console or in an S3 bucket which will be referenced from your CloudFormation template.</p><p><span style=color:#28a745>Me></span> How do you folks package your application? It appears to me as if we need to create a &ldquo;fat jar&rdquo; kind of a thing.</p><p><span style=color:#e83e8c>Hernandez></span> We use <a href=https://www.typescriptlang.org/ target=_blank rel=noopener>typescript</a>
for coding our lambda application and <a href=https://webpack.js.org/ target=_blank rel=noopener>webpack</a>
for packaging it. It does not create a zip file, just an <b>out directory</b> containing the transpiled code (js) and a handler.js file with all the required code from different node_modules plus its source map.</p><p><span style=color:#28a745>Me></span> How do you deploy your code then because you just seemed to create an output directory with a few javascript files.</p><p><span style=color:#e83e8c>Hernandez></span> We use <a href=https://docs.aws.amazon.com/cdk/latest/guide/home.html target=_blank rel=noopener>CDK</a>
for deploying our code which allows you to code your infra.</p><p><span style=color:#28a745>Me></span> Wow, the list of tools doesn&rsquo;t seem to come to an end.</p><p><span style=color:#e83e8c>Hernandez></span> It&rsquo;s simple. Just look at it this way, we have just created a directory which is ready to be deployed and moment you say <b>cdk bootstrap</b>, it will copy the contents of this out directory into another directory which will be archived and uploaded to an S3 bucket.</p><p>And when you say <b>cdk deploy</b>, you will see all the required AWS components getting deployed. Simple.</p><p><span style=color:#28a745>Me></span>Simple? You said <i>contents of this out directory will be copied into another directory</i>. Does that mean CDK already knows about the out directory?</p><p><span style=color:#e83e8c>Hernandez></span> That&rsquo;s true. When you code your infra, you will specify where is your compiled (or transpiled) or ready to be shipped code located and that&rsquo;s how CDK knows about this directory.</p><p><span style=color:#28a745>Me></span> Great, now I able to connect dots. Build your code -> get a shippable directory -> archive it -> upload it to an S3 bucket -> deploy it and CDK is one way to get all these steps done. Is that right?</p><p><span style=color:#e83e8c>Hernandez></span> Absolutely.</p><blockquote class=wp-block-quote><p>In order to deploy yours lambda function, it needs to be packaged along with its dependencies as an archive. You could use webpack if you are using typescript as a programming language. You can use CDK, CloudFormation or SAM for packaging and deploying your lambda function.</p></blockquote><p style=text-align:center><strong>. . .</strong></p><h3 id=applications-built-using-aws-lambda>Applications built using AWS Lambda</h3><p><span style=color:#28a745>Me></span> Jessica, Hernandez, what are the different types of applications that you folks have built using AWS Lambda?</p><p><span style=color:#f78c6c>Jessica></span> We have actually built <b>serverless microservices</b> using AWS Lambda and we also process <b>web clicks</b> on our application which is a stream of events flowing from user interface to <i>AWS Pinpoint</i> to <i>AWS Kinesis</i> to <i>AWS Lambda</i>.</p><p><span style=color:#e83e8c>Hernandez></span> We use AWS Lambda for <b>scaling down images</b> that are uploaded to our S3 buckets and for processing <b>DynamoDB streams</b> which is a stream of changes in DynamoDB table.</p><p><span style=color:#28a745>Me></span> Thanks Jessica and Hernandez.</p><blockquote class=wp-block-quote><p>Our panel highlighted different types of applications they have built using AWS Lambda including microservices, event processing (images on S3 buckets) and stream processing (web clicks and handling changes in DynamoDB).</p></blockquote><p style=text-align:center><strong>. . .</strong></p><p><i>With this we come to an end of our &ldquo;Virtual Podcast&rdquo; and a big Thank you to Jessica and Hernandez for being a part of this.</i> This was wonderful, and hope our readers (yes, it is still virtual) find it the same way. Thank you again.</p><h3 id=references>References</h3><ul><li><a href=https://aws.amazon.com/blogs/compute/managing-aws-lambda-function-concurrency/ target=_blank rel=noopener>Managing AWS Lambda Function Concurrency</a></li><li><a href=https://serverless.com/blog/keep-your-lambdas-warm/ target=_blank rel=noopener>Keeping Functions Warm - How To Fix AWS Lambda Cold Start Issues</a></li><li><a href=https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ target=_blank rel=noopener>Provisioned concurrency</a></li><li><a href=https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html target=_blank rel=noopener>Lambda Layer</a></li></ul></article><div class=share-buttons><ul class=share-buttons><li><a href="https://www.facebook.com/sharer/sharer.php?u=/en/blog/aws_lambda_a_virtual_podcast/" target=_blank title=Facebook><i class="fa fa-facebook-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Share on Facebook</span></a></li><li><a href="https://twitter.com/intent/tweet?text=AWS+Lambda+-+A+Virtual+Podcast%20%2Fen%2Fblog%2Faws_lambda_a_virtual_podcast%2F" target=_blank title=Tweet><i class="fa fa-twitter-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Tweet</span></a></li><li><a href="http://www.linkedin.com/shareArticle?mini=true&url=/en/blog/aws_lambda_a_virtual_podcast/&title=AWS&#43;Lambda+-+A+Virtual+Podcast%20%7C%20tech-lessons.in&summary=&source=/en/blog/aws_lambda_a_virtual_podcast/" target=_blank title=LinkedIn><i class="fa fa-linkedin fa-2x" aria-hidden=true></i>
for deploying our code which allows you to code your infra.</p><p><span style=color:#28a745>Me></span> Wow, the list of tools doesn&rsquo;t seem to come to an end.</p><p><span style=color:#e83e8c>Hernandez></span> It&rsquo;s simple. Just look at it this way, we have just created a directory which is ready to be deployed and moment you say <b>cdk bootstrap</b>, it will copy the contents of this out directory into another directory which will be archived and uploaded to an S3 bucket.</p><p>And when you say <b>cdk deploy</b>, you will see all the required AWS components getting deployed. Simple.</p><p><span style=color:#28a745>Me></span>Simple? You said <i>contents of this out directory will be copied into another directory</i>. Does that mean CDK already knows about the out directory?</p><p><span style=color:#e83e8c>Hernandez></span> That&rsquo;s true. When you code your infra, you will specify where is your compiled (or transpiled) or ready to be shipped code located and that&rsquo;s how CDK knows about this directory.</p><p><span style=color:#28a745>Me></span> Great, now I able to connect dots. Build your code -> get a shippable directory -> archive it -> upload it to an S3 bucket -> deploy it and CDK is one way to get all these steps done. Is that right?</p><p><span style=color:#e83e8c>Hernandez></span> Absolutely.</p><blockquote class=wp-block-quote><p>In order to deploy yours lambda function, it needs to be packaged along with its dependencies as an archive. You could use webpack if you are using typescript as a programming language. You can use CDK, CloudFormation or SAM for packaging and deploying your lambda function.</p></blockquote><p style=text-align:center><strong>. . .</strong></p><h3 id=applications-built-using-aws-lambda>Applications built using AWS Lambda</h3><p><span style=color:#28a745>Me></span> Jessica, Hernandez, what are the different types of applications that you folks have built using AWS Lambda?</p><p><span style=color:#f78c6c>Jessica></span> We have actually built <b>serverless microservices</b> using AWS Lambda and we also process <b>web clicks</b> on our application which is a stream of events flowing from user interface to <i>AWS Pinpoint</i> to <i>AWS Kinesis</i> to <i>AWS Lambda</i>.</p><p><span style=color:#e83e8c>Hernandez></span> We use AWS Lambda for <b>scaling down images</b> that are uploaded to our S3 buckets and for processing <b>DynamoDB streams</b> which is a stream of changes in DynamoDB table.</p><p><span style=color:#28a745>Me></span> Thanks Jessica and Hernandez.</p><blockquote class=wp-block-quote><p>Our panel highlighted different types of applications they have built using AWS Lambda including microservices, event processing (images on S3 buckets) and stream processing (web clicks and handling changes in DynamoDB).</p></blockquote><p style=text-align:center><strong>. . .</strong></p><p><i>With this we come to an end of our &ldquo;Virtual Podcast&rdquo; and a big Thank you to Jessica and Hernandez for being a part of this.</i> This was wonderful, and hope our readers (yes, it is still virtual) find it the same way. Thank you again.</p><h3 id=references>References</h3><ul><li><a href=https://aws.amazon.com/blogs/compute/managing-aws-lambda-function-concurrency/ target=_blank rel=noopener>Managing AWS Lambda Function Concurrency</a></li><li><a href=https://serverless.com/blog/keep-your-lambdas-warm/ target=_blank rel=noopener>Keeping Functions Warm - How To Fix AWS Lambda Cold Start Issues</a></li><li><a href=https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/ target=_blank rel=noopener>Provisioned concurrency</a></li><li><a href=https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html target=_blank rel=noopener>Lambda Layer</a></li></ul></article><div class=share-buttons><ul class=share-buttons><li><a href='https://www.facebook.com/sharer/sharer.php?u=/en/blog/aws_lambda_a_virtual_podcast/' target=_blank title=Facebook><i class="fa fa-facebook-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Share on Facebook</span></a></li><li><a href='https://twitter.com/intent/tweet?text=AWS+Lambda+-+A+Virtual+Podcast%20%2Fen%2Fblog%2Faws_lambda_a_virtual_podcast%2F' target=_blank title=Tweet><i class="fa fa-twitter-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Tweet</span></a></li><li><a href='http://www.linkedin.com/shareArticle?mini=true&url=/en/blog/aws_lambda_a_virtual_podcast/&title=AWS&#43;Lambda+-+A+Virtual+Podcast%20%7C%20tech-lessons.in&summary=&source=en/' target=_blank title=LinkedIn><i class="fa fa-linkedin fa-2x" aria-hidden=true></i>
<span class=sr-only>Share on LinkedIn</span></a></li></ul></div><div class=tag-list-container><div class=tag-list><a class=button href><p class=tag><i class="fa fa-fw fa-tag"></i>AWS Lambda</p></a><a class=button href><p class=tag><i class="fa fa-fw fa-tag"></i>Serverless</p></a></div></div><div class="px-2 mb-2"><script src=https://giscus.app/client.js data-repo=SarthakMakhija/tech-lessons-comments data-repo-id=R_kgDOJHu3mA data-category=Announcements data-category-id=DIC_kwDOJHu3mM4CUxhS data-mapping=og:title data-strict=0 data-reactions-enabled=1 data-emit-metadata=0 data-input-position=bottom data-theme=light data-lang=en crossorigin=anonymous async></script></div></main><footer class="container p-6 mx-auto flex justify-between items-center"><span></span>
<span class="text-base font-thin">tech-lessons.in © 2020 / Powered by <a class=font-bold target=_blank href=https://gohugo.io/>Hugo</a></span>
<span onclick='window.scrollTo({top:0,behavior:"smooth"})' class="p-1 cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentcolor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 15l-6-6-6 6h12"/></svg></span></footer><div class="search-ui absolute top-0 left-0 w-full h-full bg-white dark:bg-gray-800 hidden"><div class="container max-w-3xl mx-auto p-12"><div class=relative><div class="my-4 text-center text-2xl font-bold">Search</div><span class="p-2 absolute right-0 top-0 cursor-pointer close-search"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentcolor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></span></div><input type=search class="py-2 px-3 w-full dark:text-black border dark:border-transparent" placeholder="Enter search query"><div class="search-results text-lg font-medium my-4 hidden">Results</div><ul class="search-list my-2"></ul><div class="no-results text-center my-8 hidden"><div class="text-xl font-semibold mb-2">No results found</div><p class="font-light text-sm">Try adjusting your search query</p></div></div></div><script src=/js/scripts.min.js></script>
Expand Down
6 changes: 3 additions & 3 deletions en/blog/beginning_serverless_journey/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@
</span></span><span style=display:flex><span>});
</span></span></code></pre></div><p>I guess we are ready to do TDD as well for Serverless.</p><h3 id=summary>Summary</h3><p>Finally, we have come to an end of our first article where we made an attempt to design a small part of a serverless application that uses AWS Lambda, API Gateway and DynamoDB.</p><p>As a part of this application we have tried to draw some parallels with the MVC design pattern and bring the same to the serverless world.</p><p><strong>Items that we have left:</strong></p><ul><li>Exception handling is missing</li><li>Controller checks if the request is for getting an order. This if/else ladder will grow given the same lambda handles creation and deletion of orders.</li><li>Every component is unit testable in itself, except the repository layer that needs DynamoDB.</li></ul><p>I am sure you will be able to fill these gaps and at this stage, I will move forward.</p><p><strong>There is a lot of work still left before we can deploy the code:</strong></p><ul><li>We need to have integration test(s) which can give us confidence if this entire application is actually working or not</li><li>We need to integrate CDK (Cloud Development Kit) for deploying our infrastructure</li><li>We need to have unit tests and snapshot tests for our CDK based infra code</li></ul><p>Code is available <a href=https://github.com/aws-articles/serverless-order-service target=_blank rel=noopener>here</a>
.</p><p>Let&rsquo;s move on to our <a href=/blog/testing_serverless_journey>next</a>
article that explores integration testing using Localstack for our serverless application.</p></article><div class=share-buttons><ul class=share-buttons><li><a href="https://www.facebook.com/sharer/sharer.php?u=/en/blog/beginning_serverless_journey/" target=_blank title=Facebook><i class="fa fa-facebook-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Share on Facebook</span></a></li><li><a href="https://twitter.com/intent/tweet?text=Beginning+Serverless+Journey%20%2Fen%2Fblog%2Fbeginning_serverless_journey%2F" target=_blank title=Tweet><i class="fa fa-twitter-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Tweet</span></a></li><li><a href="http://www.linkedin.com/shareArticle?mini=true&url=/en/blog/beginning_serverless_journey/&title=Beginning&#43;Serverless+Journey%20%7C%20tech-lessons.in&summary=&source=/en/blog/beginning_serverless_journey/" target=_blank title=LinkedIn><i class="fa fa-linkedin fa-2x" aria-hidden=true></i>
article that explores integration testing using Localstack for our serverless application.</p></article><div class=share-buttons><ul class=share-buttons><li><a href='https://www.facebook.com/sharer/sharer.php?u=/en/blog/beginning_serverless_journey/' target=_blank title=Facebook><i class="fa fa-facebook-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Share on Facebook</span></a></li><li><a href='https://twitter.com/intent/tweet?text=Beginning+Serverless+Journey%20%2Fen%2Fblog%2Fbeginning_serverless_journey%2F' target=_blank title=Tweet><i class="fa fa-twitter-square fa-2x" aria-hidden=true></i>
<span class=sr-only>Tweet</span></a></li><li><a href='http://www.linkedin.com/shareArticle?mini=true&url=/en/blog/beginning_serverless_journey/&title=Beginning&#43;Serverless+Journey%20%7C%20tech-lessons.in&summary=&source=en/' target=_blank title=LinkedIn><i class="fa fa-linkedin fa-2x" aria-hidden=true></i>
<span class=sr-only>Share on LinkedIn</span></a></li></ul></div><div class=tag-list-container><div class=tag-list><a class=button href><p class=tag><i class="fa fa-fw fa-tag"></i>AWS Lambda</p></a><a class=button href><p class=tag><i class="fa fa-fw fa-tag"></i>Serverless</p></a></div></div><div class="px-2 mb-2"><script src=https://giscus.app/client.js data-repo=SarthakMakhija/tech-lessons-comments data-repo-id=R_kgDOJHu3mA data-category=Announcements data-category-id=DIC_kwDOJHu3mM4CUxhS data-mapping=og:title data-strict=0 data-reactions-enabled=1 data-emit-metadata=0 data-input-position=bottom data-theme=light data-lang=en crossorigin=anonymous async></script></div></main><footer class="container p-6 mx-auto flex justify-between items-center"><span></span>
<span class="text-base font-thin">tech-lessons.in © 2020 / Powered by <a class=font-bold target=_blank href=https://gohugo.io/>Hugo</a></span>
<span onclick='window.scrollTo({top:0,behavior:"smooth"})' class="p-1 cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentcolor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 15l-6-6-6 6h12"/></svg></span></footer><div class="search-ui absolute top-0 left-0 w-full h-full bg-white dark:bg-gray-800 hidden"><div class="container max-w-3xl mx-auto p-12"><div class=relative><div class="my-4 text-center text-2xl font-bold">Search</div><span class="p-2 absolute right-0 top-0 cursor-pointer close-search"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentcolor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></span></div><input type=search class="py-2 px-3 w-full dark:text-black border dark:border-transparent" placeholder="Enter search query"><div class="search-results text-lg font-medium my-4 hidden">Results</div><ul class="search-list my-2"></ul><div class="no-results text-center my-8 hidden"><div class="text-xl font-semibold mb-2">No results found</div><p class="font-light text-sm">Try adjusting your search query</p></div></div></div><script src=/js/scripts.min.js></script>
Expand Down
Loading

0 comments on commit 55f6178

Please sign in to comment.