<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lavanya Pidikiti on Medium]]></title>
        <description><![CDATA[Stories by Lavanya Pidikiti on Medium]]></description>
        <link>https://medium.com/@lavanyapidikiti19?source=rss-d654c8235ffc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gVK2_MTgXesiQ3e4</url>
            <title>Stories by Lavanya Pidikiti on Medium</title>
            <link>https://medium.com/@lavanyapidikiti19?source=rss-d654c8235ffc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:46:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lavanyapidikiti19/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My journey to become a developer associate]]></title>
            <link>https://medium.com/@lavanyapidikiti19/my-journey-to-become-a-developer-associate-768be207ed66?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/768be207ed66</guid>
            <category><![CDATA[aws-certification]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[aws-developer-associate]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Sat, 24 May 2025 05:54:50 GMT</pubDate>
            <atom:updated>2025-05-24T05:56:45.688Z</atom:updated>
            <content:encoded><![CDATA[<p>Journey to the center of the earth? Nahh, journey to a certified developer associate. I wanted to share with everyone on how I passed the developer associate as it would be really useful for others as well. So long story short, my college had this program called GCCF (Google cloud program) where we were asked to do a couple of google cloud labs where steps were given and do some small tasks as such. On completion of it, they give you a badge. That’s when I realized that I had a liking towards cloud as such. I completed a NPTEL course for cloud computing as well. But what’s next, is that enough? What should I really do in order to learn and grow in this field? That was the moment I thought I should learn AWS(because it was the most used cloud service). How do I learn? Enroll? Enroll in what? Then what?. Everything was researched and I decided I should try SAA(solution architect associate)-C03. Prepared hard and scored 812. I know most of you would have got a doubt that I skipped practitioner and directly took SAA, it’s that practitioner is more of high level view of the aws services and whatabouts of the same, but SAA gives you more deep view in order to configure things to construct a proper architecture following the right principles. The resources I used and tips will be shared in the course of the article. You can also find my blog about the preparation of SAA here: <a href="https://medium.com/@lavanyapidikiti19/achieving-success-passing-the-solution-architect-exam-70c55b4c43f9">https://medium.com/@lavanyapidikiti19/achieving-success-passing-the-solution-architect-exam-70c55b4c43f9</a></p><p>Did I stop with SAA?nope. I took some time and analysed through(again) and decided that I’ll try the developer associate as well. Prepared again and gave the test around May. Guess what, very tricky(but passed with 820). But I’m happy that I attempted to write the test, because SAA had 100ft view of services whereas DVA had 10ft view. Every single file, the size of file it can hold, number of reqs per second, throughput and what not. I learned a lot definitely, but also know that forthcoming exams are not going to be cakewalk.</p><h4><strong>What is DVA-C02</strong></h4><p>DVA demonstrates your technical expertise in developing and maintaining applications on the AWS platform. It validates the understanding of core AWS services, uses, and basic AWS architecture best practices. It also includes a lot of memorization where you are tested on the fact of having an experience using aws services to develop. Unlike SAA where you can skip handson just by knowing theoretical information, DVA is not like that. If you’re writing to pass(of course everyone would write just to pass), you can only pass if you’ve good and thorough hands-on experience with the services which you’re tested upon. Following dumps is a good option, but not the best after all. It only gives you a glimpse and a clarity check of what you’ve learned. I completely do not contradict the fact, because some questions do appear from the dumps, but overall the experience you gain by playing around will help you at some point in the test.</p><h4><strong>My Experience</strong></h4><p>Since I gave my SAA, I was expecting(little did I know) that DVA would also be easy, but guess what, nope it was not. I will not say it was difficult but it was rather tricky and made me think a lot. Some questions were pretty darn simple, which means straightforward and with no twist. Some were difficult and clueless. Talking about the third case where I can easily eliminate 2 options, but was confused to choose between the other two because both of them made me feel they’re a solution for the problem. Number 1 important tip, this test is to test the excellence and your knowledge on aws services and not the intuitions or the gut feelings. Think of each question as a crime investigation, the last line of the question as the main problem, gather all the hints and evidence from the context given and solve it with the right reasoning. When you doubt it, flag the question and reread it(I mean re attempt it, with a fresh mind). When you flag a question and proceed with doing the next questions, I felt you get a clue regarding the flagged question in the subsequent questions, this happened for me twice(both SAA and DVA). Once I am done with attempting all the questions, I check each and every question again from the beginning and give the reasoning to myself onto why I chose the answer and rethink if it could be wrong. Overall i took 1hr 35 mins approx to attend all 65 right away and flagging some whilst the process, and spent the rest in reiterating the checking process.</p><h4><strong>Tips and Resources</strong></h4><p>Are you even ready for the war, if you did not know what tools to use?. I used the same set of resources for DVA as well. I bought Stephane Maarek’s course from udemy and to top it off with tutorials dojo’s exam set. The udemy course is structured in a way that it prepares you for the test based domains. The course is closely aligned with the exam, yet I personally felt some of the videos were unupdated(which I read through only from blogs and a couple of other resources). The tests from TD(tutorials dojo) will boost your confidence and evaluate your understanding of the service. It also gives you a perspective on how a service can be seen as a question and what all potentially could be asked from it. But are these resources enough? Answer is No. If you’re attempting to write the exam for the first time, I recommend(strongly insist) you that you create an AWS account and do all the practical learning you can(I know it is gonna cost, but it’s worth it guys trust me). The ones who already attempted an exam previously and do not have hands-on experience, suggest you guys to at least practice some of the services in your AWS account namely Lambda, DynamoDB, SAM, CDK, Cloudformation, API Gateway, KMS.</p><h4><strong>Conclusion</strong></h4><p>Do it for learning, do it for growing and not just to get a salary hike or a promotion. I am sure this certification might open tons of doors for different jobs, but I want all of them to strongly think of learn first, achieve that and automatically you earn. All the best to everyone who’s going to attempt the exam, and congratulations if you’ve passed it already.<br>You can find my badge here: <a href="https://www.credly.com/badges/c11a2d04-030d-4422-b651-63811e47bcea/public_url">https://www.credly.com/badges/c11a2d04-030d-4422-b651-63811e47bcea/public_url</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=768be207ed66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker in simple terms]]></title>
            <link>https://medium.com/@lavanyapidikiti19/docker-in-simple-terms-314e2e77db9a?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/314e2e77db9a</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-container]]></category>
            <category><![CDATA[dockerhub]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[containerization]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 06:12:00 GMT</pubDate>
            <atom:updated>2025-01-12T06:12:00.532Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s think of Docker like preparing a meal in a kitchen.</p><h3>Traditional Cooking</h3><p>Consider yourself a chef who wants to prepare a meal in a different person’s kitchen. But the equipment, supplies, and ingredients differ from kitchen to kitchen. You may discover:</p><ul><li>The spices you require are not available.</li><li>The way their oven operates differs from yours.</li><li>The size of the pots and pans is different from what you’re used to.</li></ul><p>It becomes difficult to duplicate the same food in several kitchens as a result of this variance. Similar to this, executing apps on several systems during conventional software development might cause issues due to diverse conditions.</p><h3>Cooking with Magic Box</h3><p>Now picture yourself in possession of an exceptional cooking box. All of the ingredients, cookware and everything required are in the same place are included in this package.Your box may be placed in any kitchen.</p><p>The package contains everything needed to prepare the food in the same manner each and every time, regardless of what the kitchen has or does not have.You can pick up the box and carry it to another kitchen without creating a mess after you’re finished cooking.</p><p>This is Docker!. Your application and all of its dependencies,libraries, settings, etc. are packaged into a container by Docker. Then, without having to worry about the underlying environment, that container may operate reliably on any machine that supports Docker.</p><h3>Key Terms:</h3><ul><li><strong>Docker Image</strong>: A recipe card and a pre-packed box with all the ingredients and tools (immutable blueprint).</li><li><strong>Container</strong>: The magical box where cooking (application runtime) actually happens.</li><li><strong>Docker Engine</strong>: The chef who ensures the box works perfectly in any kitchen (Docker-enabled system).</li><li><strong>Host System</strong>: The kitchen where the magical box is placed (server or computer).</li><li><strong>Portability</strong>: You can cook in any kitchen (development, staging, or production) with the same results.</li></ul><p>So far we have seen Docker with an analogy, but technically speaking what is even Docker?</p><p>Docker is a Platform as a Service tool which helps in packaging your solution(application code) into lightweight containers which can run in any place without an issue. Have you ever wondered why Docker’s logo is a whale? Apparently to express its product’s values of expedition, automation, encapsulation and simplification. As they explain “the whale is carrying a stack of containers on its way to deliver those to you”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rO-f0CXzviI6kXwb.png" /></figure><h3>Docker Architecture</h3><p>Client:</p><p>Users may send commands and manage Docker resources via the Docker Client, a command-line tool, API, or graphical user interface. The Docker daemon receives requests from the client and coordinates the execution of those commands.</p><p>Daemon:</p><p>Running and maintaining containers and images is handled by Docker Daemon, sometimes also called as Docker Engine, a background service that runs on the host computer. Container lifecycle management and operation coordination fall within the job of daemon. It controls containers, listens for requests from the Docker client, and plans out different Docker tasks. The daemon communicates with the kernel of the host operating system and makes use of its networking, storage, and containerization capabilities and modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/0*GwRzNVpF6rZ-pdHv" /></figure><p>Registry:</p><p>Container images are stored in the Docker Registry. Docker Hub is a publicly accessible registry, and by default, Docker is set up to search for images on Docker Hub.</p><p>Now that we’ve a basic understanding of what docker is and what’s behind it, now let’s see the different commands to use and what it does.</p><h3>Setup of Docker</h3><p>Install Docker from their official website and run the setup.exe(post signing up and creating an account in docker hub)</p><p><strong>1)Check if Docker is installed</strong></p><pre>docker version</pre><p><strong>2)Pull an image</strong></p><pre>docker pull &lt;image-name&gt;</pre><p>Example:</p><pre>docker pull nginx</pre><h3>Containers</h3><p><strong>1)Run a container:</strong></p><pre>docker run &lt;image-name&gt;</pre><p>Example:</p><pre>docker run nginx</pre><p><strong>2)Run a container in the background:</strong></p><pre>docker run -d &lt;image-name&gt;</pre><p>Example:</p><pre>docker run -d nginx</pre><p><strong>3)Run a container with a specific port:</strong></p><pre>docker run -p &lt;host-port&gt;:&lt;container-port&gt; &lt;image-name&gt;</pre><p>Example:</p><pre>docker run -p 8080:80 nginx</pre><h3>Managing Your Containers</h3><p><strong>1)List running containers:</strong></p><pre>docker ps</pre><p><strong>2)List all containers (including stopped ones):</strong></p><pre>docker ps -a</pre><p><strong>3)Stop a running container:</strong></p><pre>docker stop &lt;container-id&gt;</pre><p><strong>4)Remove a container:</strong></p><pre>docker rm &lt;container-id&gt;</pre><h3>Managing Images</h3><p><strong>1)List downloaded images:</strong></p><pre>docker images</pre><p><strong>2)Remove an image:</strong></p><pre>docker rmi &lt;image-id&gt;</pre><h3>Advance comands</h3><p><strong>1)Build an image</strong></p><pre>docker build -t &lt;image-name&gt; .</pre><p><strong>2)Access a running container</strong></p><pre>docker exec -it &lt;container-id&gt; bash</pre><p><strong>3)Check logs</strong></p><pre>docker logs &lt;container-id&gt;</pre><h3>Termination</h3><p><strong>1)Remove all stopped containers:</strong></p><pre>docker container prune</pre><p><strong>2)Remove unused images:</strong></p><pre>docker image prune</pre><p>In conclusion, we have seen what docker is about, how it works and couple of commands to play along with docker.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=314e2e77db9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Application Security Testing using SonarQube]]></title>
            <link>https://medium.com/@lavanyapidikiti19/static-application-security-testing-using-sonarqube-576c84c220a7?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/576c84c220a7</guid>
            <category><![CDATA[application-security-test]]></category>
            <category><![CDATA[sast]]></category>
            <category><![CDATA[code-smells]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[sonarqube]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 03:57:02 GMT</pubDate>
            <atom:updated>2025-01-12T03:57:02.368Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Steps</strong>:</p><p>Step1)Download and install Java 17</p><p>Step2)Download and extract SonarQube</p><p>Step3)Download and extract Sonar scanner</p><p>Step4)Start SonarQube</p><p>Step5)Create a sample local project</p><p>Step6)Clone a project of your choice</p><p>Step7)Analyze your project</p><p><strong>1)Download and install Java 17</strong></p><p>Step1)Download oracle java</p><p>Step2)Set JAVA_HOME path as <strong>C:\Program Files\Java\jdk-17\bin</strong></p><p><strong>2)Download and extract SonarQube</strong></p><p>Step1)Download the SonarQube zip file and extract to C:\</p><p>Step2)Set SONAR_JAVA_PATH as <strong>C:\Program Files\Java\jdk-17\bin\java.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/0*4sd3VnDf9dhQXpOt" /></figure><p><strong>3)Download and extract Sonar scanner</strong></p><p>Step1)Download the sonar scanner zip file and extract to C:\</p><p><strong>4)Start SonarQube</strong></p><p>Step1)Start SonarQube by entering StartSonar.bat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B99fqB_y1WkSe6y9" /></figure><p>Step2)Navigate to localhost:9000 and when prompted enter admin &amp; admin as username and password. Change the password for further access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ka7FQYirPTZC7RMx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2XZQlZBI9w5LCAvQ" /></figure><p><strong>5)Create a sample local project</strong></p><p>Step1)Click on locally in projects section</p><p>Give your project name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*owqerAhR_7q5dMO5" /></figure><p>Choose Global setting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bu1gbdwR7pm1I0Hl" /></figure><p>Click on generate token and copy the token, copy the command you see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NRYX45ocTWsLcG6T" /></figure><p>Click on continue .Choose Other and OS of your choice.You can see a command , copy it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9pqGH-y1KqFBwdgV" /></figure><p><strong>6)Clone a project of your choice</strong></p><p>Step1)Go to a folder and clone any project using git clone</p><p>Step2)Either copy the files to sonar scanner folder or use the absolute path of sonar scanner to start the scan</p><p>Step3)Use the command shown in the earlier step<br><strong><em>sonar-scanner.bat -D”sonar.projectKey=TestSASTProject” -D”sonar.sources=juice-shop” -D”sonar.host.url=http://localhost:9000&quot; -D”sonar.token=sqp_ead5955fe0e659af82404a32f3dc4a61ac2d8067&quot;</em></strong></p><p><strong>7)Analyze your project</strong></p><p>Step1)Navigate to localhost:9000/dashboard and view different issues and security hotspots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LJh23-OJgmbsBE5I" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uNViddO1aWeA9C56" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VjC8HPE60JxRjt52" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=576c84c220a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EC2 Monitoring using Prometheus and visualization with Grafana]]></title>
            <link>https://medium.com/@lavanyapidikiti19/ec2-monitoring-using-prometheus-and-visualization-with-grafana-999238ec456c?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/999238ec456c</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 03:41:56 GMT</pubDate>
            <atom:updated>2025-01-10T03:41:56.290Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/621/0*ULR0hy-eGuM9tYUU" /></figure><p><strong>Explanation:</strong></p><p>Set up a monitoring system by launching three EC2 instances: one for Prometheus and two for Node Exporters. Install Prometheus on the designated instance and Node Exporter on the other two, then configure Prometheus to connect to the Node Exporters. Install Grafana on the Prometheus server, set Prometheus as the data source, and verify data visualization. Create alert rules in Grafana to monitor specific metrics and test their functionality. Verify the system’s output to ensure seamless integration and visualization.</p><p><strong>Prerequisites</strong></p><p>• AWS account with necessary permissions</p><p>Steps:</p><p>Step1) Create 3 EC2 Instances for Prometheus and Node exporters</p><p>Step2) Install Prometheus in one of the EC2 instance and Node exporter in rest 2</p><p>Step3) Connect Prometheus to Node exporters and check output</p><p>Step4) Install Grafana in Prometheus server and connect Prometheus as data source</p><p>Step5) Check visualization</p><p>Step6) Create alert rules to be fired in Grafana</p><p>Step7) Verify the output</p><h3><strong>1) Create 3 EC2 Instances for Prometheus and Node exporters</strong></h3><p>Step1)Navigate to the EC2 Services page and click on Launch Instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dhwZDLTqEvdX3qgs" /></figure><p>Step2)Since we require 2 exporters, give the count as 2 under the number of instances.Give the instance a name and choose the suitable AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-YEokD0kMNelT2OC" /></figure><p>Step3)Choose a key pair and previously created security group which is configured All TCP with an open CIDR Block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Txwo9hIx1bl2QxkK" /></figure><p>Step4) Increase the volume by 30 and click the launch instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4mTMxndlgy6VUGcI" /></figure><p>Step5)Repeat the same for the Prometheus server as well.Give a name, choose key pair, security group and increase the volume by 30.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KxWj2yr3tzYdP18o" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8iMsoXe3cHAs34oo" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DyZ4dOmUuNOhiNr2" /></figure><h3><strong>2) Install Prometheus in one of the EC2 instance and Node exporter in other 2</strong></h3><p>Step1)Now click on Prometheus server to get IP and connect to it via puTTy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nDOXbUB_hyt0fGgp" /></figure><p>Step2)Give <strong><em>sudo su </em></strong>— command to become root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*xrLwWVKP79XMqK0k" /></figure><p>Step3)Copy the linux tar file link from prometheus download and use <strong><em>sudo wget &lt;link&gt;</em></strong> to get the tar file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*273gzCBFIIcMIyt9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*FF4b2my1yjzfgIOO" /></figure><p>Step4)Use <strong><em>tar -xvzf &lt;tar file name&gt;</em></strong> command to extract the contents of the tar file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/0*oqReInTjqkUFGK6O" /></figure><p>Step5)Move the prometheus and promtool to <strong><em>/usr/local/bin</em></strong>/ using <strong><em>mv</em></strong> command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*-tzIleYjJ7LCi7oj" /></figure><p>Now to run prometheus us command</p><ul><li><strong><em>./prometheus –config.file=prometheus.yml</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iPeLnctz7uaQYS_M" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/0*m27ShJ83tD9veRcr" /></figure><p>Step6)Prometheus is up and running, now install node_exporter in other 2 EC2 instances as well by getting the link and using <strong><em>sudo wget &lt;node exporter link&gt;</em></strong> command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RckSGHGsca_l_4j-" /></figure><p>Extract the contents using <strong><em>tar -xvzf &lt;tar file name&gt;</em></strong> command. Node exporter folder need not to be moved to /usr/local/bin/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/0*VHcwe24Tia8hyM7H" /></figure><h3><strong>3) Connect Prometheus to Node exporters and check output</strong></h3><p>Step1)Navigate to config.yml of prometheus and add other two nodes details as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FX0sve5-RMPOj7U9" /></figure><p>Rerun prometheus by killing and restarting it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*dd9N44PhBUxNh1FS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XjXLc2US4gHz0z5Y" /></figure><p>Prometheus dashboard output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sBZ2WzDzoQBP-0_-" /></figure><h3><strong>4) Install Grafana in Prometheus server and connect Prometheus as data source</strong></h3><p>Step1)Go to the grafana downloads page and choose OSS under edition.Now you can see the list of commands under Linux.Copy and perform the actions as said.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ta_8UnOvMBs1qdHd" /></figure><p>Step2)When grafana is running, login with default credentials such as admin admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jAJeqDwdW0kcAZH3" /></figure><p>Step3)When it prompts you to change the password, change the password as you require.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9IW8jkZNTW2AgFfa" /></figure><p>Step4)Below is the grafana dashboard and click on add your first data source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RjmYxWTVfFM_GQHP" /></figure><p>Step5)In that choose Prometheus and data source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kTvoKKpjlDuIIt85" /></figure><p>Step6)Since both grafana and prometheus run on the same server, we can use <a href="http://localhost:8080/">http://localhost:8080</a> under the prometheus url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kHTeg-Edjsjwkar-" /></figure><p>Step7)Click on save and test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lCGbj2vGz1qN5OtZ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r6aPnKYE56_S1TyY" /></figure><p>Step8)Import a node exporter dashboard for grafana to display different metrics of the same</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yhFuSM0zFL9NKz-r" /></figure><h3><strong>5) Check visualization</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_4WTTol6tILTxtgX" /></figure><h3><strong>6) Create alert rules to be fired in Grafana</strong></h3><p>Step1)Now click on alert rules of grafana and under that, give your alert a name, and choose a suitable metric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2iSZctU8uvbi1FVs" /></figure><p>Step2)Scroll down and under threshold give the condition on which you want to be alerted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d39F1HPRfmCHE37q" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7tNwww-I3rdrorkD" /></figure><p>Step3)Give a notification message body and choose grafana default mail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*leVL8adHwFqjA4Ae" /></figure><p>Step4)Now wait until the rule transitions from active-&gt;pending-&gt;firing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3j5xgKk_qQllp1_l" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eq5nPds3rDp72k9o" /></figure><h3><strong>7) Verify the output</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YwYF-eb71vwakJfg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=999238ec456c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring EC2 using Cloudwatch and send notifications on SNS]]></title>
            <link>https://medium.com/@lavanyapidikiti19/monitoring-ec2-using-cloudwatch-and-send-notifications-on-sns-4eaaec31e300?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4eaaec31e300</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[sns]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[metrics]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 03:37:39 GMT</pubDate>
            <atom:updated>2025-01-09T03:37:39.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/551/0*6e9CtzyIateT0s_c" /></figure><p><strong>Explanation:</strong></p><p>The process involves creating an EC2 instance, setting up a CloudWatch alarm to monitor its metrics, and linking it to an SNS topic for notifications. Once configured, you verify that the alarm triggers the SNS notification when the metric threshold is breached. Finally, you clean up by terminating the EC2 instance and associated resources to avoid unnecessary costs.</p><p><strong>Prerequisites</strong></p><p>• AWS account with necessary permissions</p><p>Steps:</p><p>Step1) Creation of EC2 Instance</p><p>Step2) Creation of Cloudwatch alarm and SNS Topic with subscription</p><p>Step3) Verification of the notification when in Alarm state</p><p>Step4) Termination of Resources</p><h3><strong>1)Creation of EC2 Instance</strong></h3><p>Step1)Navigate to the EC2 Service page of AWS Console and click on launch instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Izm438bYokvO1i6T" /></figure><p>Step2)Give your instance a name and choose a suitable AMI of your choice. Here in our case we’ve chosen Amazon Linux AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZTZTveLT9hMk0b2g" /></figure><p>Step3)Choose the previously created key pair which is lin-pwd in our case and pre existing security group</p><p>This security group is configured in such a way that it’s inbound rule is</p><ul><li>All TCP</li><li>Open CIDR Block</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/0*6FlqP1gOg02sUlvF" /></figure><p>Step4)In the advanced settings, click on enable for detailed monitoring of cloudwatch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*ap1dGhtJed18-plc" /></figure><p>Step5)Wait until 2/2 checks are passed for the instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rCDULr_trN_e-gih" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L0tpY29PhsfI9hPv" /></figure><h3><strong>2)Creation of Cloudwatch alarm and SNS Topic with subscription</strong></h3><p>Step1)Go to the cloudwatch service and click on create alarm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PlmpizefMmnvKp4E" /></figure><p>Or</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xSA3tKEShkvPpkYW" /></figure><p>Step2)Click on select metric. Choose the metric of your choice</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MgFG1e0PZ4WXnFgg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lSsLzUIbTs216Xh_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jNFUb7r7foSmWFf-" /></figure><p>As we’re going to monitor the EC2, we click on EC2&gt;per instance metrics&gt;CPU Utilization. Click on select metric</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eF9JbgqUGNpa9o7R" /></figure><p>Step3) Make sure to select the created instance and it’s name in the metric section and provide the threshold range</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J3cXORxZLinlAgGx" /></figure><p>Step4)In the configure actions, check create a new SNS Topic.Give your topic a name and then enter the email address of which you want to be notified for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*94u9tTgafpUhLDOi" /></figure><p>Click on create topic</p><p>Step5) Add a name for the alarm and description as well for better understanding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lEXAMejtmmrCitkH" /></figure><p>Step6)Preview once and click on create</p><p>Step7)Alarm created successfully, yet SNS Subscription is pending. Check the inbox of the provided email and confirm the subscription</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*khOGXCcZHLxQz8-i" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jwaRejZYiU26LFu2" /></figure><p>Click on confirm subscription</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/0*p5dlhIRdrj5Qn9AB" /></figure><p>Step8)Now similarly create another alarm, but for another metric of EC2 which is <strong>EBSWriteBytes.</strong>We navigate to EC2&gt;Per instance metrics&gt;EBSWriteBytes and select it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yb8DFteFlrxj511f" /></figure><p>Step9)Follow the similar process of creating a SNS topic and adding the endpoint email.Give your alarm a name and description and proceed with creating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-phawM7hrC4EBe0C" /></figure><p>Verification step:</p><p>You can go to the instance page and check whether any alarms are attached to it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1T8F8HUZDHQa4T1s" /></figure><h3><strong>3)Verification of the notification when in Alarm state</strong></h3><p>Now when CPU Utilization is greater than 1 or EBSWriteBytes is greater than 1 we get an email notification</p><p>CPUUtilization notification:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RbK5eVS1yoUOMmpN" /></figure><p>VolumeWrite Notification:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5sJvsWzbQ_n-Y_hP" /></figure><p>Cloudwatch alarm dashboard: point to alarm state for the created alarms</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pueIRo85frVF-tyv" /></figure><h3><strong>4)Termination of Resources</strong></h3><p>Step1)Proceed with first deleting the alarms</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VDFO4O2quHS6TNIL" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rHvIriC4vCwIHstA" /></figure><p>Step2)Terminate the EC2 Instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aiCgQqTQ0COLs8FS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QPCfDs1bqSIC3K7O" /></figure><p>Step3)Delete the created SNS Topic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3_rO9gQfwxPNvhJS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HcthtkSrfyWpIn-V" /></figure><p>Delete the subscriptions as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QYTBeuE3Z5BUnHKS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SjVHF4XEj0Rj7pCX" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4eaaec31e300" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2048-Game Hosting Using EBS]]></title>
            <link>https://medium.com/@lavanyapidikiti19/2048-game-hosting-using-ebs-5eca7708ab40?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eca7708ab40</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[beanstalk]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 15:27:37 GMT</pubDate>
            <atom:updated>2025-01-08T15:27:37.793Z</atom:updated>
            <content:encoded><![CDATA[<p>To deploy an application using AWS Elastic Beanstalk, navigate to the service and create an application with a name, tags, and a Docker-based platform. Prepare a Dockerfile that sets up an NGINX server and deploys a sample application, then upload it as the application code. Create an IAM role with the AWSElasticBeanstalkWebTier permission and attach it to the environment under the instance profile. Configure environment settings such as gp3 volume and disable unnecessary options. Launch the environment, which automatically provisions resources like Auto Scaling Groups, Elastic IPs, and Security Groups, and provides a domain URL upon successful deployment. Verify the application, then terminate resources by deleting the environment, role, and emptying associated buckets.</p><p><strong>Prerequisites</strong></p><p>• AWS account with necessary permissions</p><p>Steps:</p><p>Step1) Create a Environment in EBS</p><p>Step2) Verification of Output</p><p>Step3) Termination of resources</p><h3><strong>1) Create a Environment in EBS</strong></h3><p>Step1)Navigate to Elastic BeanStalk and click on create application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zGXb2bLUOEq5GxWi" /></figure><p>Step2)Give your application a name, under tags a key and value as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8IN1nS95ZJxA6gBa" /></figure><p>Make sure to ready a dockerfile like this</p><pre>FROM ubuntu:22.04<br>RUN apt-get update<br>RUN apt-get install -y nginx zip curl<br>RUN echo &quot;daemon off;&quot; &gt;&gt;/etc/nginx/nginx.conf<br>RUN curl -o /var/www/html/master.zip -L https://codeload.github.com/gabrielecirulli/2048/zip/master<br>RUN cd /var/www/html/ &amp;&amp; unzip master.zip &amp;&amp; mv 2048-master/* . &amp;&amp; rm -rf 2048-master master.zip<br>EXPOSE 80<br>CMD [&quot;/usr/sbin/nginx&quot;, &quot;-c&quot;, &quot;/etc/nginx/nginx.conf&quot;]</pre><p>Step2)Choose Docker as a platform and upload the above code as a local file for application code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QpLX7OYkEduzhiuG" /></figure><p>Step3)Meanwhile for your environment to have suitable permissions, click on IAM&gt;roles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fqJ-GjTemRb1GHL8" /></figure><p>Step4)Click on create a new role and for trusted entity use case choose EC2, Click next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PQ3GRPaQzfAYhhke" /></figure><p>Step5)Give your role a name and choose <strong>AWSElasticBeanstalkWebTier</strong> permission to the role and click create role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Txh_FDtOTa0VDE6l" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rUbRuVZUjUN09qHq" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VAI-x0iBNSu85YhG" /></figure><p>Step6)Now attach the role to the environment under the Instance profile section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0VK5SSoV6yYz9Z5R" /></figure><p>Step7)Step3 and Step5 are default and no changes.Under step4 choose gp3 volume, and uncheck the IMsD check box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2pvhwl32iAitbSwz" /></figure><p>Now below displays the event logs of the environment where it created ASG, EIP, Security groups etc. Once the environment launch is successful you can see the domain URL.</p><h3><strong>2)Verification of Output</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x17lqcV1hAcUV0eW" /></figure><h3><strong>3)Termination of Resources</strong></h3><p>Step1)Delete the environment as well as the role. Empty the created buckets and terminate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L51cqNzPpkvlqWWT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z-lhHisrRJwSVs-O" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eca7708ab40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrate Jenkins with Nexus Repository OSS and Bitbucket server — Part 2]]></title>
            <link>https://medium.com/@lavanyapidikiti19/integrate-jenkins-with-nexus-repository-oss-and-bitbucket-server-part-2-94020bbbcb14?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/94020bbbcb14</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[nexus]]></category>
            <category><![CDATA[bitbucket]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 15:21:40 GMT</pubDate>
            <atom:updated>2025-01-07T15:21:40.144Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Integrate Jenkins with Nexus Repository OSS and Bitbucket server — Part 2</strong></h3><h3><strong>Step5)Bitbucket setup</strong></h3><p>Step1)Now create a repository of your choice to hold the maven project under your bitbucket workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*93BH30ezsgaIF_Nd" /></figure><p>Step2)Clone the repo to your local desktop and add the required files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DaITg41yBRmens8K" /></figure><p>Step3) Use commands</p><ul><li><strong><em>git add .</em></strong></li><li><strong><em>git commit -m “message”</em></strong></li><li><strong><em>git push</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*93UaWRpJcSo73jVP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*iB3yw97YufeOOqXU" /></figure><p>Step4)Now you can see the pushed content in the console of bitbucket dashboard page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PWcwhANKMralKmqn" /></figure><p>Step5)In the side nav bar you can see access tokens, click on access tokens and create one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SuemoO2Lb8BYDcAM" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sGQmnlUiVUhsYfEY" /></figure><p>Step6)Choose the required permissions and click on create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*umkbffrDnjzc6j3j" /></figure><p>Sample access token:</p><p>ATCTT3xFfGN0mD9ELCtyqvRCDTl-&lt;some code..&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hKgTp4M9nkCSUjv3" /></figure><p>Now in the same nav bar you can see webhooks at the side, click on that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bQIVSQe3eT4Pgll_" /></figure><p>Step7)Click on add webhook, give the hook a name(title) and for url <br>http://&lt;public IPv4 Of jenkins instance&gt;:8080/&lt;hook name&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HjbcNVqGXgSHWqJ-" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CyvODpA8Oq5asxgB" /></figure><p>Step8)Choose the suitable trigger types and click on save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*shBnHGywf3RhR-CG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sO1XGrVjiqbLLVrK" /></figure><p>Step9)Note the username of the bitbucket login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/0*GPb2LAJyFp-s9Vhg" /></figure><p>Step10)Click on manage jenkins&gt; credentials&gt; system&gt;global credentials and add credentials for bitbucket server and nexus user(you created the user earlier)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ynlZVbhwhKwEkr0b" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ESXf4icVJegekbFR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kjg_6cHKlxZjWR28" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BajJWxxenkACaTfD" /></figure><p>Step11)Add the credentials as said above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kqw8n8L30Lcfqs5T" /></figure><p>Step12)Click on new item and select pipeline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-DQW-tjlMnRPSeOz" /></figure><p>Step13)Give a description for the pipeline and select bitbucket webhook trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*sN6T2xzvpaoMH5Rs" /></figure><p>Step14)Copy the id of the credential that you created for nexus user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*adoVVhvqo4pV1ZOI" /></figure><p>Step15)Copy the url and paste it in the pipeline script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GJkgu_AOoY7FbRYx" /></figure><pre>pipeline {<br>  agent any<br>  tools {<br>    maven &#39;maven&#39; // Use your Maven tool name<br>    jdk &#39;java-17&#39; // Use your JDK tool name<br>  }<br>  environment {<br>    NEXUS_VERSION       = &quot;nexus3&quot;<br>    NEXUS_PROTOCOL      = &quot;http&quot;<br>    NEXUS_URL           = &quot;https://6eb2-2401-4900-1cc8-cbb0-8d41-46fb-6ae6-181.ngrok-free.app&quot; // Your Nexus hosted URL<br>    NEXUS_REPOSITORY    = &quot;Jenkins-repo&quot; // Your Nexus repository name<br>    NEXUS_CREDENTIAL_ID = &quot;8a59d770–64b9–4137–9f61–021fcaa23729&quot; // Your credentials ID stored in Jenkins<br>    APPLICATION_NAME    = &quot;Lavanya&quot; // Any name of your choice<br>    VERSION             = &quot;1&quot;<br>    GIT_REPO_URL        = &#39;https://lavanyapidikiti@bitbucket.org/lavlavlav/jenkins-test.git&#39; // Your Git repository URL<br>    GIT_BRANCH          = &#39;main&#39; // Set the branch name if needed<br>  }<br>  stages {<br>    stage(&#39;Checkout&#39;) {<br>      steps {<br>        // Checkout the code from the Bitbucket repository<br>        git branch: &quot;${GIT_BRANCH}&quot;, url: &quot;${GIT_REPO_URL}&quot;<br>      }<br>    }<br>    stage(&#39;Build&#39;) {<br>      steps {<br>        // Run &#39;mvn clean package&#39; to ensure the artifact is generated<br>        sh &#39;mvn clean package&#39;<br>      }<br>    }<br>    stage(&#39;Push to Nexus&#39;) {<br>      steps {<br>        script {<br>          def pom = readMavenPom file: &quot;pom.xml&quot;<br>          def filesByGlob = findFiles(glob: &quot;target/*.${pom.packaging}&quot;)<br>          if (filesByGlob.size() &gt; 0) {<br>            def artifactPath = filesByGlob[0].path<br>            def artifactExists = fileExists artifactPath<br>            if (artifactExists) {<br>              echo &quot;File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version: ${pom.version}&quot;<br>              nexusArtifactUploader(<br>                nexusVersion: NEXUS_VERSION,<br>                protocol: NEXUS_PROTOCOL,<br>                nexusUrl: NEXUS_URL,<br>                groupId: pom.groupId,<br>                version: pom.version,<br>                repository: NEXUS_REPOSITORY,<br>                credentialsId: NEXUS_CREDENTIAL_ID,<br>                artifacts: [<br>                  [<br>                    artifactId: pom.artifactId,<br>                    classifier: &#39;&#39;,<br>                    file: artifactPath,<br>                    type: pom.packaging<br>                  ],<br>                  [<br>                    artifactId: pom.artifactId,<br>                    classifier: &#39;&#39;,<br>                    file: &quot;pom.xml&quot;,<br>                    type: &quot;pom&quot;<br>                  ]<br>                ]<br>              )<br>            } else {<br>              error &quot;File: ${artifactPath} could not be found&quot;<br>            }<br>          } else {<br>            error &quot;No artifacts found in the target directory&quot;<br>          }<br>        }<br>      }<br>    }<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iDaipIM0DMEGGBgo" /></figure><p>Step16)Start the build and if it’s successful, upload will be successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XINEHJHxD3Rvylj0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bNstWSgfgDMXB21P" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QH_BsJg04jvoJjaV" /></figure><p>Step17)Jar files are sent to the created repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FzfjaCW58yOH_Ud-" /></figure><p>Step18)Delete the EC2 Instance as well as the docker container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VUQRcP4aptlDUgZh" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RmAYk8wbl1MHYU6z" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94020bbbcb14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrate Jenkins with Nexus Repository OSS and Bitbucket server — Part 1]]></title>
            <link>https://medium.com/@lavanyapidikiti19/integrate-jenkins-with-nexus-repository-oss-and-bitbucket-server-part-1-61d6200f2415?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/61d6200f2415</guid>
            <category><![CDATA[bitbucket]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[nexus]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 15:12:06 GMT</pubDate>
            <atom:updated>2025-01-06T15:12:06.200Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Integrate Jenkins with Nexus Repository OSS and Bitbucket server — Part 1</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/0*EIoZZAy_fQTifjAf" /></figure><p><strong>Technologies Used:</strong> Maven</p><p><strong>Prerequisites</strong></p><p>• AWS account with necessary permissions</p><p>• Bitbucket account to store and manage your source code</p><p>Steps:</p><p>Step1) Setup Nexus OSS in Docker</p><p>Step2) Create EC2 Instance and setup Jenkins</p><p>Step3) Setup Maven, git</p><p>Step4) Install necessary plugins</p><p>Step5) Configure Bitbucket</p><p>Step6) Setup Bitbucket server</p><p>Step7)Verification of output</p><h3><strong>Step1) Setup Nexus OSS in Docker</strong></h3><p>Step1)Navigate to the docker desktop, and open a terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uIs5QTJoE4OnVmTq" /></figure><p>Step2)Paste <strong><em>docker run -d 8081:8081 –name sonatype/nexus3</em></strong> command to pull the image first if not available in local and run the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pDAluS2EnucrrXls" /></figure><p>Step3)The below image shows that the container is up and running with the nexus3 image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*thaWPPO_CrMiY86a" /></figure><p>Step4) The dashboard of docker desktop shows the url of the container, it might take some time (couple of 3–5 mins) for it to be displayed or else you might see an error message saying localhost did not respond, or sent an empty data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KJKu-KNWcy9RnINN" /></figure><p>Step5)The loading page of sonatype nexus is shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sod1HRwND6DGPzLj" /></figure><p>Step6)This is the dashboard of the nexus repo, now click on sign in button on the top right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yPo7ZYSlC0-cesBY" /></figure><p>Step7)To login using username as admin and get the password from /nexus-data/admin.password. Using a normal cat command won’t work because the image is running in a docker container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yag2E7MheHxEEgV5" /></figure><p>Step8)Use the command <strong><em>docker exec it &lt;container_id&gt; cat /nexus-data/admin.password </em></strong>to retrieve the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yyT8hNzBFvsfUc_T" /></figure><p>Step9)Paste the received password in sign in page and proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tx2j2dgq8A2Ei_sZ" /></figure><p>Step10)When prompted change the password and proceed to login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BWwF0FjZ9D7uqjlo" /></figure><p>Step11)Choose to enable anonymous access as it’s for our learning purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eEXKNiN9U28RLhnR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VK0tsGx8Rx3-W197" /></figure><p>Step12)Click on the settings (gear icon) and you can see users in the side navbar, click on the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vW2lpvrkztGoxDH9" /></figure><p>Step13)Click on create local user and give the ID, name, email address, password and choose nx-admin (nexus admin role) and proceed to create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z7cNW8J-v5AuexaS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I0f3065wBCmDEWLv" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BQCxv8VDHXbDkdLg" /></figure><p>Step14)Click on repositories and click create repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bckIp1kLyknvDQG4" /></figure><p>Step15)Choose maven2(hosted)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Lf2Th7Xb7MK13eF" /></figure><p>Step16)Give your repo a name, choose mixed, strict, inline and allow redeploy under deployment policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jIGkPFx0TTOO1a95" /></figure><p>Step17)Successfully created the repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HZxy1DXS0fzQDcqB" /></figure><p>Step18)Now even though we’ve hosted out nexus container, our jenkins server in the VPC will not be able to access nexus container.Hence we’re hosting this url in ngrok</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XqZCMto9rwAe2Z7Y" /></figure><p>Step19)Proceed with a signup page and confirm the mail which you’ve given while signing up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*43G521TbYhOBnnVf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/0*dvwErQE-78LN6dpW" /></figure><p>Step20)Post confirmation you can see that you’ve commands to install the ngrok, which you can do using choco or normal installer file. I proceeded with choco and ran the command in the admin command prompt to have access to choco services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fWW8E3JyutXdlLRb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/0*GOvct9FkiQ-zyPpu" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B_jSXaq1a8Ts-rzn" /></figure><p>Step21)Choco is up and running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7KRid1qMPKo_xz_V" /></figure><p>Step22)Go to the url given in the command prompt and click on visit site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MsFIkNkL4PXdRIZG" /></figure><p>Step23)Sign in using the credentials you created for the new user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YcM4BoiWPteKX0ai" /></figure><p>Step24)You can still see the repository that you created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VTsupl4mv5pQnJqm" /></figure><h3><strong>Step2) Create EC2 Instance and setup Jenkins</strong></h3><p>Step1)Navigate to the EC2 Services page and click on launch instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7GE2Jd76Pt8e1LKm" /></figure><p>Step2)Give your instance a name and choose amazon linux 2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Wf69NHOH5jH2nyb" /></figure><p>Step3)Choose the earlier created key pair, a security group configured to All TCP with open CIDR Block.Make sure to have 30GB Volume and click on launch instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tqOBCVNqNh6GH1Yj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r5VgKdK__TS5YGC4" /></figure><p>Step4)Wait for the instance to initialize and once you see 2/2 checks passed, click on connect</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RCTRsnsPtczl4z3R" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p96jJcObJ0GKElt6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/0*6Wx4xWEjD_Os0R3w" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O6aqx63xek7xtz2Y" /></figure><p>Step5) Get the root privileges by <strong><em>sudo su </em></strong>— and install jenkins</p><ul><li><strong><em>sudo wget -O /etc/yum.repos.d/jenkins.repo \ </em></strong><a href="https://pkg.jenkins.io/redhat-stable/jenkins.repo"><strong><em>https://pkg.jenkins.io/redhat-stable/jenkins.repo</em></strong></a></li><li><strong><em>sudo rpm — import </em></strong><a href="https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key"><strong><em>https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key</em></strong></a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jLI7zJyaQm6C7veV" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4RMlNP6_nvWV5-3E" /></figure><p>Step6)We should install amazon-corretto java-17</p><ul><li><strong><em>sudo yum install java-17-amazon-corretto -y</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/0*2RmVjFRNewlWbmh6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*swteME9Wz21WAisY" /></figure><p>Step7)Now start the jenkins service using command</p><ul><li><strong><em>systemctl jenkins start</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NBFvuQcr51BeAIS5" /></figure><p>Step8)Now copy the public IPv4 address of Jenkins instance and append :8080 to see the jenkins page</p><ul><li><strong>&lt;IPv4&gt;:8080</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WhQIRjntQzt2xVhb" /></figure><p>Step9)To login initially it says the admin password is in that path, as shown below in the image now we do<strong><em> sudo cat &lt;path&gt;</em></strong> to get the passwords</p><ul><li><strong><em>sudo cat /var/lib/jenkins/secrets/initialAdminPassword</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6GccbhJfp6Yqm2qH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*5KTjY7n0lNtUmsBe" /></figure><p>4ae3fcf9056c4f158ff499a723427dd5 -&gt; don’t copy it won’t work :))</p><p>Step10)Click on install available plugins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VCdphWyz8r-VrFCa" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rU7ylR0DsMzOsF6E" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ICm6lRA_edWysNdH" /></figure><p>Step11)Dashboard of Jenkins.Jenkins installed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l1gT8h2npijM3gP0" /></figure><h3><strong>Step3) Setup Maven, git</strong></h3><p>Step1) Use command <strong><em>sudo yum install git -y </em></strong>to install git</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MkQP5uOzKN2s8Yg7" /></figure><p>Step2)Go to the maven download page and click on binary tar archive, copy the link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CxNJrfQGcjPoHRPS" /></figure><p>Step3)Navigate to the path /opt and use <strong><em>sudo wget &lt;binary tar.gz file link&gt;</em></strong> to get the tar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F14XysUCQwN4LSIA" /></figure><p>Step4)Use <strong><em>tar -xvzf &lt;tar file&gt;</em></strong> to extract the contents of the tar file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/0*y2yG8H3mvVkwAFrL" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*PmA9-QyuZIUvw_pz" /></figure><p>Step5) Note the home path of maven /opt/maven<br>Step6) Open ~/.bash profile in nano editor and paste the below content</p><p><strong>M2_HOME=/opt/maven</strong></p><p><strong>M2=$M2_HOME/bin</strong></p><p><strong>PATH=$PATH:$HOME/bin:$M2_HOME:$M2</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h5PEDog77ynD0AKx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*awWaXGLAmvR7A-TY" /></figure><p><strong>Step4) Install necessary plugins<br></strong>Step1)Go to the jenkins dashboard and click on Manage jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vSi1WSPICsUQn_S-" /></figure><p>Step2)Now click on plugins card and install the list of plugins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RZETak2PS_t2HCYe" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qfsHUfvs1qj2eZvt" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j-AUdq98P4xu1F6S" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fld_qj8F-6kaJGNc" /></figure><p>Step3)Add JDK and Maven path in the tools sections of manage jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VvV2E9sqBGCLw0Hn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*baGk9f5Hw0DHWhwk" /></figure><p>Click save and apply.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61d6200f2415" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application hosting in EC2 using Terraform]]></title>
            <link>https://medium.com/@lavanyapidikiti19/application-hosting-in-ec2-using-terraform-b721b60b30d9?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/b721b60b30d9</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[subnet]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Sun, 05 Jan 2025 15:06:01 GMT</pubDate>
            <atom:updated>2025-01-05T15:06:01.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/581/0*OHZnW6iqBdahZpJ5" /></figure><p><strong>Explanation:</strong></p><p>Write Terraform code to provision resources, including a VPC, subnet, internet gateway, route table, security group, and the EC2 instance itself. Use user_data to configure the instance with HTTPD and create a basic webpage. Initialize Terraform with terraform init, plan resources with terraform plan, and apply the configuration using terraform apply to create the resources. Verify the setup by checking the instance and application output. Finally, use terraform destroy to clean up all resources and terminate the instance.</p><p><strong>Prerequisites</strong></p><p>• AWS account with necessary permissions</p><p>Steps:</p><p>Step1) Create a EC2 Instance</p><p>Step2) Create role for the same</p><p>Step3) Install Terraform</p><p>Step4) Code the required resources</p><p>Step5) Use the terraform commands for the resources to be created</p><p>Step6) Verification of output</p><p>Step7) Destroy</p><h3><strong>1) Create a EC2 Instance</strong></h3><p>Step1)Navigate to the EC2 Page and click on launch instance, give your instance a name and choose amazon linux 2023 AMI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tDYuaOLgzUTTRIxy" /></figure><p>Step2)Select the previously created key pair and security group which is configured to have All TCP and open CIDR block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iROtYHtAqgQOF3jz" /></figure><p><strong>2) Create role for the same<br></strong>Step1)Now create a role attaching EC2FullAccess permission and VPCFullAccess permission.Below image shows a terraform-role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W1CQs7bgS7d60qES" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HQSbEq0khLO9-SXU" /></figure><p>Step2)Now attach the created role by clicking on the instance and going to actions&gt;security&gt;Modify IAM Role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ErJzLtFPq4xpAb6R" /></figure><p>Step3)Attach the IAM Role and click on update.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gSVfkT_muBOhyPnx" /></figure><h3><strong>3) Install Terraform</strong></h3><p>Step1)Navigate to the installation site of terraform which is hashicorp and click on linux and choose amazon linux<br>You can find the commands</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n5Syy7NXuVbMrqRL" /></figure><ul><li><strong><em>sudo yum install -y yum-utils</em></strong></li><li><strong><em>sudo yum-config-manager — add-repo </em></strong><a href="https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo"><strong><em>https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo</em></strong></a></li><li><strong><em>sudo yum -y install terraform</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fFDnOGoCNYtkk-SV" /></figure><p>Step2) Check the installation using <strong><em>terraform -version</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Re5piTdsR8jfyCxp" /></figure><h3><strong>4) Code the required resources</strong></h3><p>Step1)Firstly navigate to terraform documentation and then choose aws provider and copy the provider code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D2HWOlo-aTYdoGFj" /></figure><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;5.74.0&quot;<br>    }<br>  }<br>}<br><br>provider &quot;aws&quot; {<br>  # Configuration options<br>}</pre><p>Step2)Next proceed by adding region in the provider</p><p>Take the VPC Code by navigating to vpc section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Ka9A4oB2_62d8Hd" /></figure><p>Give your vpc a reference name and name inside tags</p><pre>resource &quot;aws_vpc&quot; &quot;vpc_lav&quot; {<br>  cidr_block       = &quot;10.0.0.0/16&quot;<br>  instance_tenancy = &quot;default&quot;<br><br>  tags = {<br>    Name = &quot;vpc-lav&quot;<br>  }<br>}</pre><p>Step3)Creation of subnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j1ofgqWEvVYAWz2-" /></figure><pre>resource &quot;aws_subnet&quot; &quot;pub_sub&quot; {<br>  vpc_id     = aws_vpc.vpc_lav.id<br>  cidr_block = &quot;10.0.20.0/24&quot;<br><br>  tags = {<br>    Name = &quot;pub_sub&quot;<br>  }<br>}</pre><p>Step4)Creation of Internet Gateway</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y4xUV8JL0qd6jgMn" /></figure><pre>resource &quot;aws_internet_gateway&quot; &quot;my_new_gw&quot; {<br>  vpc_id = aws_vpc.vpc_lav.id<br><br>  tags = {<br>    Name = &quot;my_new_gw&quot;<br>  }<br>}</pre><p>Step5)Creation of route table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zLYm2wX4fHW4CVVL" /></figure><pre>resource &quot;aws_route_table&quot; &quot;pub_rt&quot; {<br>  vpc_id = aws_vpc.vpc_lav.id<br><br>  route {<br>    cidr_block = &quot;0.0.0.0/0&quot;<br>    gateway_id = aws_internet_gateway.my_new_gw.id<br>  }<br><br>  tags = {<br>    Name = &quot;pub-rt&quot;<br>  }<br>}</pre><p>Step6)Creation of route table association</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u9zqGWftdNDfQX5o" /></figure><pre>resource &quot;aws_route_table_association&quot; &quot;pub_assoc&quot; {<br>  subnet_id      = aws_subnet.pub_sub.id<br>  route_table_id = aws_route_table.pub_rt.id<br>}</pre><p>Step7)Creation of Security group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F29qwnDVW0T__rl5" /></figure><pre>resource &quot;aws_security_group&quot; &quot;pub_sg&quot; {<br>  name        = &quot;allow_all&quot;<br>  description = &quot;Allow all inbound traffic and all outbound traffic&quot;<br>  vpc_id      = aws_vpc.vpc_lav.id<br><br>  tags = {<br>    Name = &quot;pub_sg&quot;<br>  }<br>}<br><br>resource &quot;aws_vpc_security_group_ingress_rule&quot; &quot;allow_https_ipv4&quot; {<br>  security_group_id = aws_security_group.pub_sg.id<br>  cidr_ipv4         = &quot;0.0.0.0/0&quot;<br>  from_port         = 443<br>  ip_protocol       = &quot;tcp&quot;<br>  to_port           = 443<br>}<br><br>resource &quot;aws_vpc_security_group_ingress_rule&quot; &quot;allow_ssh_ipv4&quot; {<br>  security_group_id = aws_security_group.pub_sg.id<br>  cidr_ipv4         = aws_vpc.vpc_lav.cidr_block<br>  from_port         = 22<br>  ip_protocol       = &quot;tcp&quot;<br>  to_port           = 22<br>}<br><br>resource &quot;aws_vpc_security_group_egress_rule&quot; &quot;allow_all_traffic_ipv4&quot; {<br>  security_group_id = aws_security_group.pub_sg.id<br>  cidr_ipv4         = &quot;0.0.0.0/0&quot;<br>  ip_protocol       = &quot;-1&quot; # semantically equivalent to all ports<br>}</pre><p>Step8)Creation of ec2 instance</p><p>Copy the AMI Id</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*liEBKeOQD1_hErFU" /></figure><pre>resource &quot;aws_instance&quot; &quot;my_instance&quot; {<br>  count                       = 1<br>  ami                         = &quot;ami-06b21ccaeff8cd686&quot;<br>  instance_type               = &quot;t2.micro&quot;<br>  subnet_id                   = aws_subnet.pub_sub.id<br>  security_groups             = [aws_security_group.pub_sg.id]<br>  associate_public_ip_address = true<br><br>  tags = {<br>    Name = &quot;my_instance&quot;<br>  }<br><br>  user_data = &lt;&lt;-EOF<br>    #!/bin/bash<br>    yum update -y<br>    yum install -y httpd<br>    echo &quot;My name is Lavanya.&quot; &gt; /var/www/html/index.html<br>    systemctl enable httpd<br>    systemctl start httpd<br>  EOF<br>}</pre><p>Now after writing the code, open an editor of your choice and paste the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/0*8sYCO7bGP2Le-dBb" /></figure><p>Step9)Use <strong><em>terraform init</em></strong> for initializing terraform in the instance and <strong><em>terraform plan </em></strong>to check what all resources will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*ardLscR__-T7MmyN" /></figure><h3><strong>5) Use the terraform commands for the resources to be created</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*CSP94R7emkoIVgPg" /></figure><p>Step1)Give <strong><em>terraform apply</em></strong> to these resources to be created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QwyqDi2apLFG4j4X" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i2AC21hxS_oZw672" /></figure><h3><strong>6) Verification of output</strong></h3><p>Step1)Instance created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x_N7NFG3d7OIu0P7" /></figure><p>VPC and Subnet is associated with our instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JA_IAZvnYNEwHmoL" /></figure><p>Application output. (If the application is not showing up use all TCP with open CIDR Block in security group)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B0KWkdRvLc9wthE-" /></figure><h3><strong>7) Destroy</strong></h3><p>Step1)Use <strong><em>terraform destroy</em></strong> to destruct all the created resources</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XoIq1ce2WMf7qkcy" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OXPZO6fSYbI779Af" /></figure><p>Terminate the terraform instance as well from EC2 Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0GlBTI1tTxulDRJ0" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b721b60b30d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VPC AND VPC Peering]]></title>
            <link>https://medium.com/@lavanyapidikiti19/vpc-and-vpc-peering-42526e83d3b2?source=rss-d654c8235ffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/42526e83d3b2</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[internet-gateway]]></category>
            <category><![CDATA[nat-gateway]]></category>
            <category><![CDATA[subnet]]></category>
            <category><![CDATA[vpc-peering]]></category>
            <dc:creator><![CDATA[Lavanya Pidikiti]]></dc:creator>
            <pubDate>Sat, 04 Jan 2025 07:31:43 GMT</pubDate>
            <atom:updated>2025-01-04T07:31:43.788Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/431/0*SBQUoSMYnFMNT8Er" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/0*5NxukBt1heRNhJ9C" /></figure><p><strong>Explanation:</strong></p><p>The task revolves around setting up a Virtual Private Cloud (VPC) in AWS, creating subnets, establishing internet connectivity, and enabling secure communication between EC2 instances in both public and private subnets. The main objective is to configure a NAT gateway for internet access from a private subnet, configure route tables for directing traffic appropriately, and establish security groups to control inbound and outbound traffic. Once the VPC and its associated resources (subnets, route tables, internet gateway, NAT gateway, and security groups are created, two EC2 instances (one public and one private) are launched to test connectivity. The successful configuration ensures that the public EC2 instance can access the internet, while the private EC2 instance gains internet access via the NAT gateway. The process involves using RDP for Windows instances and SSH for Linux instances to verify the configuration through ping tests and other connectivity checks.</p><p>The second part of the project involves VPC peering across different regions to enable communication between EC2 instances in separate VPCs. This is done by establishing a peering connection between VPCs in North Virginia (us-east-1) and Mumbai (ap-south-1). The VPC peering allows traffic to flow securely between subnets in different regions. Once the peering connection is established and routes are updated in both VPCs, a Windows EC2 instance in the private subnet of the North Virginia VPC can securely connect to a Windows EC2 instance in the private subnet of the Mumbai VPC.</p><p><strong>Pre-requisites:</strong></p><p>• AWS account with necessary permissions</p><p><strong>Task-1: </strong>Access EC2 instance in a private subnet via a NAT gateway and check if there’s internet</p><h3>1) Creation of VPC</h3><p>Step1)Navigate to the VPC Page, and click on create VPC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UwyGcAc3QEo2fG5U" /></figure><p>Step2)Choose VPC only as it create VPC alone, and now give your VPC a name and a CIDR block of your choice with /16 to get 65535 IPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*zK4Cmk6_J2yqTaez" /></figure><p>Step3)VPC Creation is successful when you see a notification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KQVGi_KX9sV1mezg" /></figure><h3>2)Create 2 Subnets</h3><p>Step1)Navigate to Subnets part of VPC and click on create subnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hQfJ_kTuTvzWijil" /></figure><p>Step2)Give your subnet a name, choose an availability zone and the ipv4 CIDR block falling within the VPC set of addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*2qno0xf37CBhTCdp" /></figure><p>Step3)Repeat the same for private subnet. Give your subnet a name, choose an availability zone and the ipv4 CIDR block falling within the VPC set of addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*tSIHQ4XOMay7aHiY" /></figure><p>Step4) Successful creation of subnets shows a notification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hm2uV0Y8bWhDEodQ" /></figure><h3>3)Create Internet Gateway</h3><p>Step1)Navigate to the Internet Gateway and click on create Internet gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OBkI6Qn5EAKlN-cJ" /></figure><p>Step2)Give your ig a name and click on create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/0*tIvjrzAO81HMjqCi" /></figure><p>Step3)Now on successful creation of the internet gateway, you can see a notification that attach to VPC.Click on the same</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oIr7IXIQ0TjCs6gg" /></figure><p>Step4) Choose the created VPC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*flJr-FLAnj8UjNff" /></figure><h3>4)Create 2 Route tables</h3><p>Step1)Navigate to the route table part of VPC and click on create route table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vPMIM7bnrQkxZ50S" /></figure><p>Step2)Give your route table a name, choose the VPC and proceed with creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*ACYr1B_5CRGgHg-a" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LRaQVtgrtQ5aGXUs" /></figure><p>Step3)Repeat the same. Give your route table a name, choose the VPC and proceed with creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/0*rlFMf7bFop6u8VZW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s28Lp-G9t71giCTg" /></figure><p>Step4) Now you can see the created route tables in the route tables dashboard, click on the subnet and edit subnet associations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rpaRXgoM_iSnq5xL" /></figure><p>Choose the private subnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MxhgfCnaVRGI4dmE" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ut_WSqsQgfcGGCYD" /></figure><p>Step5)Repeat the same for the public routetable. Now you can see the created route tables in the route tables dashboard, click on the subnet and edit subnet associations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CBQUcz8H6eTEyteh" /></figure><p>Choose the public subnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dnXcwmMwSLp8aUED" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G8ocmdvT9rbVaa7v" /></figure><h3>5)Attach Internet Gateway to public route table subnet</h3><p>Step1)Click on the public route table and go to routes, click on edit routes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MOPFWya1o3tuo__F" /></figure><p>Step2)Click on add route, and give open CIDR block and Internet gateway. Choose the created internet gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FGluMKGUMlqVdqM6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BLmzDKg9tWJiRuVK" /></figure><h3>6)Create NAT Gateway</h3><p>Step1)Navigate to NAT gateway and click on create NAT gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KKOWIiIwLmHwRBqP" /></figure><p>Step2)Give your NAT gateway a name, choose <strong>public subnet </strong>and click on allocate elastic IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*dq91O4HAox3a_Pn1" /></figure><p>Step3)Proceed with creation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*snq_H1Tk9gM3MmKa" /></figure><p>Step4)The NAT gateway shows pending as its state and wait till its available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y50j8FIlb-K-nCDR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pdpZQnrHKCHfifVD" /></figure><h3>7)Associate NAT Gateway with private route table</h3><p>Step1) Go back to route table and click on edit routes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FWmzmRsVM82Ckc3p" /></figure><p>Step2)Choose open CIDR Block and NAT gateway in target and choose the created NAT Gateway from dropdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HbjmYkFRarEvo8-U" /></figure><p>Step3) Updated successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VtGFqHvM9sO9LmVB" /></figure><h3>8)Creation of dedicated security groups</h3><p>Step1) Go to the security groups section and click on create security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*43ULLKDW_I6Lrhyh" /></figure><p>Step2)Give your security group a name, choose the VPC and in inbound rules for public sg use open CIDR block with all TCP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vPn9ulWcqs6rlsfi" /></figure><p>Step3)Review and click create</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pP8AMjzW3Rcagm2C" /></figure><p>Step4)Successful creation of a security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dOPIyCKakrCFtS6n" /></figure><p>Step5)Now create private security group , by just allowing public security group alone</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MRQvW_LhIvYvimG7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TShHgfgP9JIXw4Kf" /></figure><h3>9)Creation of EC2 instances and connection-Windows edition</h3><p>Step1)Give your instance a name and choose windows version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*twxSdQwMik3UNfd6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*tMIJ830wSzZTSIEp" /></figure><p>Step2) Edit the network settings and for private choose private subnet, private security group and disable public IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rkM8MCVyUjIfIMIR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hhtmtq2NTO5QgrMc" /></figure><p>Step3)Similarly repeat the process for public, by choosing public subnet, public security group and enable public IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p9fPFO-RsZep_tMU" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EtDYm0JF3NjmhyxU" /></figure><p>Step4)Wait until two instances are up and running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x6IgjDt_0F9MJnLy" /></figure><p>Step5) Copy the public instance IP and connect it using RDP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fhQ5OIdr8jGbKCMl" /></figure><p>Step6) Use the RDP Client and get username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4WF7okEhEtF590Tz" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/0*gv6SvQACROkCapyh" /></figure><p>Step7)Connect it using the same</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zzQhrK9-J_WIlWKX" /></figure><p>Step8) You can see there’s successful connection and network is passing to public instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lDOfuAuEVbIP6l3f" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1G0nmxRXTjncoNYK" /></figure><p>Step9)Verification with ping command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oPcQsv5BAuz-9EiH" /></figure><p>Step10)Now connect it to the private ec2 instance via public one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NDNWszFq2_hzpXPk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/0*2PslxgM0AocGER6s" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eZxdJVWRGUBIdcPf" /></figure><p>Step11)Copy the created password and access the private instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/0*VsmM1nbZtHPaenxp" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JFvXmRpkYHwaG5cn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cRpWBvbkmbnCwLQt" /></figure><p>We can see that the network is passing through the private instance as well, now give yes and proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O1hG_MASbtWIUek-" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oOCfSynPVSZmCLuf" /></figure><p>Step12)Verification with ping command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nQoswsuO3nYBebTx" /></figure><h3>VPC Peering</h3><p>Repeat the same steps above mentioned but in a different region.</p><p>Step1)Creation of VPC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b_eyc4PPXofx2Qxo" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ezb75neRhxpZMrj3" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*unYXQ1baNU2NI3jr" /></figure><p>Step2)Creation of subnets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q-N7E1HpbxJ4Jlkx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/0*RSRSG5Ggl7HfKPbU" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7RMrORvxWGWSO_m1" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qB06wx_xWkyDH9aN" /></figure><p>Step3)Creation of Internet Gateway</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N_4gFCRcZSgnFBVb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*genfWrbAFUq7O4sz" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CJ0xmZiNGqTH8U9T" /></figure><p>Step4)Attachment of Internet Gateway to VPC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Uv5IjlztZXoCLY2" /></figure><p>Step5)Creation of route tables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sDeScJCMbSRWHR0F" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BOfYbtQyivpqHdXN" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xjGWSpKPRnN1suav" /></figure><p>Successful creation of route table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DGsNp_r55fyCX_f1" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YtzfvioUp0mUrx80" /></figure><p>Step6)Add the subnet association with each route table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9FmkDx6TQWhk91Z4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yHTFFosP5Hlddnyn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Rq49FbHEuLQ6KBJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xfyj-wGWzXDDjqHu" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pVcLlp02km5PbWIn" /></figure><p>Successful updation of subnet association in route tables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FjCeP4_4KpPUooTH" /></figure><p>Step7)Add the route of internet gateway in public route table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fQyunAAlofJIs5S-" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KZlRalHusjDIqJuE" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gnSciUSlCdrbtUtv" /></figure><p>Step8)Creation of NAT Gateway</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mkpDn990HDRryRSf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sZENHNllvOpKQjr8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rt247mFGrBet8YEj" /></figure><p>NAT Gateway in available state</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BIxFEuRv0w3xmWS9" /></figure><p>Step9)Associate NAT with private route table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TtdDiR67lUPC3hZp" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FhMzOhTJ5E83MMj4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2zKV-4_cA7BN6w5C" /></figure><p>Step10)Creation of security group — private</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ey8jcwRKidcvKqlB" /></figure><p>Give the private subnet address of zone a in inbound rules of private security group of zone b</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EHiMx5z4uJzy1JLx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M--3M0-1YOPRxW13" /></figure><p>Step11)Creation of EC2 instance with windows ami</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lGU8pDtRn38NTb8B" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*f5kLiQPGnRjuOJYi" /></figure><p>Step12)Edit the network settings, to choose the VPC you created, private subnet, disable public IP and select the existing security group.Launch the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7tKR3sJMFqrubNag" /></figure><p>Step13)As 2/2 checks are passed now, we can connect, but there’s a step before to connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*95RR3SYbQtFIqU1d" /></figure><p>Step14)Go back to zone A which is North virginia in my case and edit the VPC as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*klksSIUDkn86-3Wj" /></figure><p>Check the enable DNS hostname and save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/0*CWxhRgLjvzCYodz7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5-zc5Rfqy-ZJNNkK" /></figure><p>Step15)Repeat the same for subnet, by editing the subnets and enabling assign public IPv4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y27EehDr4HemAZdS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*1MD1hUNf-jjWIbEH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*US1f8ikNFxPNZPGb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/0*NPRDMQpLGLRkTRbj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*blTyWobZcDsIz9LR" /></figure><p>Step16)Now click on create peering connection after navigating to VPC section of zone A</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nSFFrNehmTMLJk3d" /></figure><p>Copy the VPC id which is in the same account yet in another region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xXzx20_n-2_6MaNZ" /></figure><p>Step17) Give your peering connection a name, choose the requester as the VPC in zone A which is North Virginia and acceptor as Mumbai . Choose the same account in another region and paste the VPC ID copied from another region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*x0fAkWrcNlzhqdwK" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XwpVDkwmi8jdxQ6s" /></figure><p>Step18)Going back to the zone b which is Mumbai, you can see a request in peering connection, click on accept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uYEXM-cp2L65Nh7v" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XLXgzoe-JYNeQrpZ" /></figure><p>Successful setup of peering connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A1FlWuDHh8BP5cP_" /></figure><p>Step19)Now edit the private route tables of each zone as to allow the other subnet traffic in form of peering connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zhBvv1_0L03Pk_p0" /></figure><p>Click on edit route and give the subnet IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hMmbiNSocWXYT_Hy" /></figure><p>Perform the same for Mumbai’s private route table as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b1A0PK1PcTnszA9a" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7tn5K6q3N_Clu6eQ" /></figure><p>Step20)Now we’re completely done with the peering setup and now can proceed with connection to the private ec2 instance in a private subnet of another zone(Mumbai) from our zone(North Virginia).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gp5LgC9slkjVKSkT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*37WALSoKkR2l57bs" /></figure><p>As shown in the above images, decrypt the password and use the credentials to via RDP from private subnet of zone A.</p><p>Step21)We can see that there’s internet connection which means we’ve done our steps correctly :))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g68uK6I9snvpZ6d8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XvOk9chpYbNCpxp" /></figure><p>Step22)Verify the same by doing a ping command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xvCcbbCh9Xyh71ui" /></figure><p><strong>Creation of EC2 instances and connection-Linux Edition</strong></p><p>Step1)Creation of EC2 instances in each zone with names priv-ec2-a, pub-ec2-a, priv-ec2-b respectively with amazon linux as OS and Amazon Linux 2 AMI as your selection.</p><p>Give the previously created key pair and edit the network settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*OVXGCSUxztkMAW0P" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/0*SOtTfrkqq7b_QqQ3" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/0*jk0R-x-oFY72SvQR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/0*3XB1KRAhr6MYBrVb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UzeBFbUDILhSrBm8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aEBBfdkORIdkD7DZ" /></figure><p>Since the previously created security groups are for windows, edit the same to reflect for linux which is SSH</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U9VfQK2lzj7FewmQ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x_gxxUm5c9yUGXCE" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5GiHGDcUEhnA2g1B" /></figure><p>Connect it using puTTy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*plcuj3F2vkcDinyh" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*yPBpyHTGEAHrfc9D" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*8Xoz3Vubi3kIG7OB" /></figure><p><strong>Termination of resources:</strong></p><ul><li>Deletion of Peering connection</li><li>Deletion of EC2 instances</li><li>Deletion of VPC</li><li>Deletion of other resources first if VPC Deletion isnt successful</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sNW_2CHLfyeU_w57" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U98hWduIjReNYnY8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QNuqvLuVCGeDA-j4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yyk-ldROK3RtUZR7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MFszwYNfoLTIsePP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mp7EcjMJtxapV9MX" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42526e83d3b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>