<?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>DEV Community: KaviiSuri</title>
    <description>The latest articles on DEV Community by KaviiSuri (@kaviisuri).</description>
    <link>https://dev.to/kaviisuri</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%2F406938%2Ff5739a73-cc47-48af-8e38-118ffbe523ae.jpeg</url>
      <title>DEV Community: KaviiSuri</title>
      <link>https://dev.to/kaviisuri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaviisuri"/>
    <language>en</language>
    <item>
      <title>Never Get Stuck! As a Software Engineer</title>
      <dc:creator>KaviiSuri</dc:creator>
      <pubDate>Mon, 29 Aug 2022 10:39:00 +0000</pubDate>
      <link>https://dev.to/kaviisuri/never-get-stuck-as-a-software-engineer-5aei</link>
      <guid>https://dev.to/kaviisuri/never-get-stuck-as-a-software-engineer-5aei</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;As software engineers, our job is to solve problems. And the reality of the job is, getting stuck sometimes. Please do not think you are less of a software developer or engineer just because you get stuck often. It's part of the job!&lt;/p&gt;

&lt;p&gt;In this article, I'll outline a few things you can do to be &lt;strong&gt;unstuck&lt;/strong&gt;. No matter what your stack or your problem, this process will be useful in finding the solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google It!
&lt;/h2&gt;

&lt;p&gt;Yeah. It sounds basic, but I can't even count how many people skip this. Just take the error that is popping up or the situation that you are in and &lt;strong&gt;Google It!&lt;/strong&gt; It's half our job! &lt;br&gt;
&lt;a href="https://www.reddit.com/r/coolguides/comments/wxoq10/how_to_enhance_your_google_searches/"&gt;Here are a few tips on how to google it better&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Write it down!
&lt;/h2&gt;

&lt;p&gt;Okay, most of the time, you'll just get the answer on google. But if you don't, it's time to get your writing skills out. Just write down the problem you are facing, the probable causes, and the feasible solution you can think of. &lt;/p&gt;

&lt;p&gt;Sometimes, just doing this helps you think of a solution. Writing helps you understand the problem better. You solve stuff better if you understand it.&lt;/p&gt;

&lt;p&gt;From now on, take time to document your understanding, possible solutions and everything. I know it's a lot of effort, but it's worth doing.&lt;/p&gt;
&lt;h2&gt;
  
  
  RTFM!
&lt;/h2&gt;

&lt;p&gt;Okay, again a basic one, but &lt;strong&gt;Read the F&lt;/strong&gt; ing Manual!** The excellent engineers behind the tools you use are also kind enough to write documentation. Treat it as the single source of truth. Understand how things work. You might find a solution or a better understanding to think of one.&lt;/p&gt;
&lt;h2&gt;
  
  
  You Ain't a Snowflake
&lt;/h2&gt;

&lt;p&gt;As much as we want to feel like snowflakes, we aren't. At least in the context of building software. Your project might be different, and the problem might feel different, but chances are &lt;strong&gt;someone faced this issue before.&lt;/strong&gt; So look for people who were where you are right now. &lt;/p&gt;

&lt;p&gt;Search on forums, GitHub issues, stack overflow, and maybe even subReddits. &lt;/p&gt;
&lt;h2&gt;
  
  
  Take a Break!
&lt;/h2&gt;

&lt;p&gt;If you still haven't solved the problem, take a break. Fresh eyes are amazing at giving new perspectives. You don't need someone else for fresh eyes, you can just take a break.&lt;/p&gt;

&lt;p&gt;When you'll come back to the desk. Read what you wrote down. You'll get a different perspective. You'll get more ideas. Write them down and start experimenting.&lt;/p&gt;
&lt;h2&gt;
  
  
  Be Hands-On
&lt;/h2&gt;

&lt;p&gt;I've seen many people do it. I've done it myself. We tend to work on research about a problem and forget to experiment with them. You don't need the perfect solution. Just start implementing one and remember. Git is your best friend in this. Don't mess up your progress because you forgot to commit stuff before your experimentation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Ask For Help
&lt;/h2&gt;

&lt;p&gt;Once you've done everything you can, and written everything down. Ask For Help. Rephrase your documentation into a consumable summary and ask for help. Reach out to seniors or colleagues and send them the document. This way you don't waste their time as you have the resources upfront. &lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--kHqQy1-O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1485295581996400642/8DF4LROs_normal.jpg" alt="Kavii Suri profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Kavii Suri
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @kavii_suri
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Asking good questions simply boils down to awareness of your intentions. &lt;br&gt;&lt;br&gt;It's very important to ask ourselves, are we actually asking out of confusion or simply delegating to escape the boring research and efforts.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      13:46 PM - 01 Jan 2022
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1477275075334131712" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1477275075334131712" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1477275075334131712" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Ask Online
&lt;/h2&gt;

&lt;p&gt;While you talk to your seniors, put the internet to work. Take the question you asked your colleague. Also, post it on online communities like&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;StackOverflow&lt;/li&gt;
&lt;li&gt;GitHub issues of the technology&lt;/li&gt;
&lt;li&gt;SubReddits like r/webdev r/programming and even specific ones to your technology&lt;/li&gt;
&lt;li&gt;Discord servers &lt;/li&gt;
&lt;li&gt;Twitter (reach out to me at &lt;a href="https://twitter.com/kavii_suri"&gt;@kavii_suri&lt;/a&gt;) &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Share! Share! Share!
&lt;/h2&gt;

&lt;p&gt;Once you're at this stage and hopefully have found a solution, remember to share. Why? Because the software community thrives on this. Remember how I said &lt;strong&gt;someone faced this issue before&lt;/strong&gt;? Well, be that someone for someone else.&lt;/p&gt;

&lt;p&gt;If you can help at least one person, that's worth it! Of course, there are benefits of posting online: personal branding, and networking but in the end, this isn't just about that, it's also about giving back to the community that supports you every day.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>How to setup CD for AWS Elastic Beanstalk using CodePipeline?</title>
      <dc:creator>KaviiSuri</dc:creator>
      <pubDate>Tue, 31 Aug 2021 15:45:31 +0000</pubDate>
      <link>https://dev.to/kaviisuri/how-to-setup-cd-for-aws-elastic-beanstalk-using-codepipeline-555a</link>
      <guid>https://dev.to/kaviisuri/how-to-setup-cd-for-aws-elastic-beanstalk-using-codepipeline-555a</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;So, Now you have your code running on AWS. It's secure and cheap, but you still have to upload your code in zip files. How archaic😱!! Let's fix this in this article using another awesome AWS Service called the CodePipeline. This is gonna be a short one guys.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This article is a sequel to the previous one called  &lt;a href="https://kavii.hashnode.dev/how-to%20setup-a-https-server-in-elastic-beanstalk-the-cheap-way"&gt;How to setup a https server in elastic beanstalk&lt;/a&gt;. It's not required to read the previous one, but I would recommend doing so before reading this. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is Code Pipeline?
&lt;/h2&gt;

&lt;p&gt;It is an AWS Service that provides fully managed, continous devlivery that helps you automate the release pipelines for fast and reliable application and infrastructure.&lt;br&gt;
You can automate various phases like &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build&lt;/li&gt;
&lt;li&gt;Test&lt;/li&gt;
&lt;li&gt;Deploy
and this automation will run every time there is a code change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It supports various source code sources, we'll be using github but there is very little difference in how to use any other service if you need to.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Setup CD
&lt;/h2&gt;

&lt;p&gt;Go to code pipeline option in your console and press "Create New Pipeline". &lt;/p&gt;

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

&lt;p&gt;Enter the name and leave everything as default. Click "Next"&lt;/p&gt;

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

&lt;p&gt;In the source stage, select the provider and fill in the details. We'll be using Github (Version 2) here.&lt;/p&gt;

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

&lt;p&gt;If you require a build stage, configure this step. We'll be skipping this stage.&lt;/p&gt;

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

&lt;p&gt;In the deploy stage, select AWS Elastic Beanstalk and fill other details.&lt;br&gt;
Click "Next" and review everything. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Once you submit, your pipeline will be active. Now, as soon as you push code to github, it'll reflect in your deployment very soon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Readme Badges
&lt;/h3&gt;

&lt;p&gt;If you need github readme badges, refer to &lt;a href="https://medium.com/swlh/aws-ci-cd-dynamic-build-badge-display-on-github-1e9a3b76db5a"&gt;this article&lt;/a&gt; for how to set it up. You can also use  &lt;a href="https://www.npmjs.com/package/cdk-pipeline-status"&gt;this npm library&lt;/a&gt;  for monitoring the status.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to setup a https server in Elastic Beanstalk (The Cheap Way)?</title>
      <dc:creator>KaviiSuri</dc:creator>
      <pubDate>Mon, 30 Aug 2021 10:38:33 +0000</pubDate>
      <link>https://dev.to/kaviisuri/how-to-setup-a-https-server-in-elastic-beanstalk-the-cheap-way-7ei</link>
      <guid>https://dev.to/kaviisuri/how-to-setup-a-https-server-in-elastic-beanstalk-the-cheap-way-7ei</guid>
      <description>&lt;p&gt;Yeah.. I know, the title is a mouth full. To be honest, this is a very specific and niche usecase I faced and found no condensed resources. So, here is my attempt making one!! I hope this article helps you in the journey towards learning new things!!&lt;/p&gt;

&lt;h2&gt;
  
  
  Objectives
&lt;/h2&gt;

&lt;p&gt;With this article, I just aim to setup a server with following properties :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTPS - Secure Web Server.&lt;/li&gt;
&lt;li&gt;Auto renewal of SSL certificates (from let's encrypt).&lt;/li&gt;
&lt;li&gt;Elastic beanstalk with single instance mode (no load balancer)&lt;/li&gt;
&lt;li&gt;Automatic Continous Deployment from github. &lt;strong&gt;Coming Up in the next Article&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since This might be a lot to take in, I'll write a seperate article on Continous Deployment.&lt;/p&gt;

&lt;p&gt;I followed these steps for a project that had minimum requirements and tight budget constraints. I &lt;strong&gt;do not&lt;/strong&gt; recommend this for bigger projects where scale matters a lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR;
&lt;/h2&gt;

&lt;p&gt;If you know elastic beanstalk and just want to know how to setup SSL, refer to this &lt;a href="https://github.com/vahiwe/Elastic-Beanstalk-Single-Instance-SSL" rel="noopener noreferrer"&gt;source code from vahiwe&lt;/a&gt; and copy the &lt;code&gt;.platform&lt;/code&gt; and &lt;code&gt;.ebextensions&lt;/code&gt; folders into your application.  Source of this code is this &lt;a href="https://aws.plainenglish.io/setup-ssl-https-on-elastic-beanstalk-single-instance-environment-d748ea04437d" rel="noopener noreferrer"&gt;awesome article by vahiwe&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Do not forget to set &lt;code&gt;DOMAIN_LINK&lt;/code&gt; and &lt;code&gt;EMAIL_LINK&lt;/code&gt; environment variables for the domain you want ssl certificate for and the email associated with it respectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why bother reading this?
&lt;/h2&gt;

&lt;p&gt;Although you might not face these specific conditions, this article will contain stuff that I didn't understand before this. Sometimes, we treat things like SSL, Nginx etc as black boxes that just do stuff, but &lt;strong&gt;The craft of engineering is about understanding the parts and making a better whole.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up AWS Elastic Beanstalk
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is Elastic Beanstalk?
&lt;/h3&gt;

&lt;p&gt;Elastic Beanstalk or EB is an easy to use service from AWS for deploying and scaling web applications. It supports both uploading your code manually and stuff like CD by using AWS Code Deploy. It manages various things like creating new EC2 instances automatically, deploying your code to the server, starting your applications and much &lt;strong&gt;much&lt;/strong&gt; more.&lt;/p&gt;

&lt;p&gt;There are no extra charges for EB, you just pay for what you use e.g. EC2 instances, Load Balancers, CodeDeploy Pipelines etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Do I setup one?
&lt;/h3&gt;

&lt;p&gt;Setting up a basic EB project is simple.&lt;/p&gt;

&lt;h4&gt;
  
  
  Create new EB Environment
&lt;/h4&gt;

&lt;p&gt;In your AWS console, go to elastic beanstalk option and click "Create new Application"&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faharc4f7654j3zj14o8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faharc4f7654j3zj14o8x.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
Fill everything up and click "Configure More Options"&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kkra23aj16j2ewuk3m5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kkra23aj16j2ewuk3m5.png" alt="image"&gt;&lt;/a&gt; &lt;br&gt;
Make sure, the presets selects "Single Instance" and the Load Balancer Option says "This Configuration does not contain a load balancer"&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1cbrw52adtdzp6o8vjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1cbrw52adtdzp6o8vjn.png" alt="image"&gt;&lt;/a&gt; &lt;br&gt;
Select all other options that you require like Databases, Software Environment Variables etc and Click "Create App"&lt;br&gt;
This will create a default environment for you.&lt;br&gt;
Congrats, you now have a single instance EB application online. But it doesn't have your app. 😕&lt;/p&gt;
&lt;h3&gt;
  
  
  Configure your application code for Elastic Beanstalk to support HTTPS
&lt;/h3&gt;

&lt;p&gt;This step will be the quickest to do but the weirdest to understand.&lt;/p&gt;
&lt;h4&gt;
  
  
  A little Background
&lt;/h4&gt;

&lt;p&gt;Elastic Beanstalk has a lot of features, some of them being providing a way to configure your application environment, do tasks pre and post deployments, customizing AWS resources and much more.&lt;br&gt;
Most of it is done through special folders that live in your code base, specifically &lt;code&gt;.ebextensions&lt;/code&gt; and &lt;code&gt;.platform&lt;/code&gt; (.platform is supported for Amazon Linux 2 (recommended) instances, for Amazon Linux 1, we use just ebextensions)&lt;/p&gt;
&lt;h4&gt;
  
  
  What is HTTPS (A simplified version) ?
&lt;/h4&gt;

&lt;p&gt;It is the secure version of HTTP which encrypts data that is transfered to increase secureity.  HTTPS not only encrypts the data but also helps the browser make sure that the data is going to the place it says it's going to. It identifies that when you send or recieve something from &lt;code&gt;google.com&lt;/code&gt;, it goes and comes from &lt;code&gt;google.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;How all this is done is outside the scope of this article, but all you need to know is that this identification process requires a Certificate Authority to provide a "certificate" that is sent over and identifies your domain. We'll be using a well known and free certificate authority called let's encrypt. These certificate have exipiry dates and need renewal. Let's Encrypt provides a cli that can help us generate these programmatically.&lt;/p&gt;
&lt;h4&gt;
  
  
  Setting up Nginx
&lt;/h4&gt;

&lt;p&gt;Elastic beanstalk uses nginx as a default reverse proxy for your application, you can configure it and extend it by adding a &lt;code&gt;.conf&lt;/code&gt; file to a folder name &lt;code&gt;.platform/nginx/conf.d&lt;/code&gt; in your application source. These files are included automatically. A reverse proxy basically maps all incoming requests to suitable servers. You can learn a lot more about nginx on the web. It's a very large and intresting subject to read about.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/workspace/my-app/
|-- .platform
|   -- nginx
|       -- conf.d
|           -- myconf.conf
|-- other source files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll be using this &lt;a href="https://github.com/vahiwe/Elastic-Beanstalk-Single-Instance-SSL" rel="noopener noreferrer"&gt;source code from vahiwe&lt;/a&gt; and copy the &lt;code&gt;.platform&lt;/code&gt; folders. The working of this is explained in this &lt;a href="https://aws.plainenglish.io/setup-ssl-https-on-elastic-beanstalk-single-instance-environment-d748ea04437d" rel="noopener noreferrer"&gt;awesome article by vahiwe&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installing Certbot
&lt;/h4&gt;

&lt;p&gt;We use the &lt;code&gt;.ebextensions&lt;/code&gt; folder from the same repo as above. It contains a &lt;code&gt;ssl.config&lt;/code&gt; which is a EB config file and allows us to run some commands in the environment programmatically.&lt;br&gt;
This file has the following &lt;code&gt;container_commands&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;container_commands&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;10_downloadepel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;wget&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-r&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--no-parent&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-A&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;'epel-release-*.rpm'&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/"&lt;/span&gt;
  &lt;span class="na"&gt;20_installepel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;rpm&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-Uvh&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--force"&lt;/span&gt;
  &lt;span class="na"&gt;30_enableepl&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;yum-config-manager&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--enable&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;epel*"&lt;/span&gt;
  &lt;span class="na"&gt;40_installcertbot&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;yum&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;install&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-y&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;certbot"&lt;/span&gt;
  &lt;span class="na"&gt;50_getcert&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;certbot&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;certonly&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--debug&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--non-interactive&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--email&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;${EMAIL_LINK}&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--agree-tos&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--standalone&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--domains&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;${DOMAIN_LINK}&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--keep-until-expiring&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--pre-hook&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;service&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;nginx&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;stop&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;--post-hook&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;sudo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;service&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;nginx&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;start&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;
  &lt;span class="na"&gt;60_link&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ln&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;-sf&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;/etc/letsencrypt/live/${DOMAIN_LINK}&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;/etc/letsencrypt/live/ebcert"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installs certbot and all it's dependencies in the AWS environment. It generates a SSL certificate using certbot for the first time using the environment variables &lt;code&gt;DOMAIN_LINK&lt;/code&gt; and &lt;code&gt;EMAIL_LINK&lt;/code&gt;, these are required variables and should be set from the EB console.&lt;/p&gt;

&lt;h4&gt;
  
  
  Setting up autorenewal
&lt;/h4&gt;

&lt;p&gt;The file also contains this piece of code that sets up a scheduled job or cron job that renews certbot weekly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;#.... (stuff)&lt;/span&gt;
&lt;span class="na"&gt;files&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;/etc/cron.d/certbot_renew&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@weekly&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;root&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;certbot&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;renew&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;
    &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
    &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;000644"&lt;/span&gt;
    &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
&lt;span class="c1"&gt;#.... (more stuff)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;And, there you have it, your application running on Elastic Beanstalk, with SSL security. You can just drag and drop a zip in Elastic Beantsalk Console for you environment and it'll deploy it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But what about CD?&lt;/strong&gt; Well, this article has become too long and has a lot of information. I'll be posting another short one soon with details about how to do CD.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>nginx</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
