<?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 Sankha Gunathunga on Medium]]></title>
        <description><![CDATA[Stories by Sankha Gunathunga on Medium]]></description>
        <link>https://medium.com/@pramudithasankha?source=rss-91d9167dafaa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZpmEvJvdmXTDNQ2dezxIkg.jpeg</url>
            <title>Stories by Sankha Gunathunga on Medium</title>
            <link>https://medium.com/@pramudithasankha?source=rss-91d9167dafaa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:52:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pramudithasankha/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[Password issues for AWS Windows custom ami.]]></title>
            <link>https://medium.com/@pramudithasankha/password-issues-for-aws-windows-custom-ami-1d7d8194eb96?source=rss-91d9167dafaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d7d8194eb96</guid>
            <category><![CDATA[ami]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Sankha Gunathunga]]></dc:creator>
            <pubDate>Sun, 16 Jun 2024 08:12:17 GMT</pubDate>
            <atom:updated>2024-06-16T08:12:17.133Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone! Creating and managing AWS Windows custom AMIs can streamline your cloud operations, but handling password issues can be tricky. In this article, we’ll explore common password challenges and share simple solutions to keep your instances secure and efficient.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F26u6bnal23NhnIoZG%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F26u6bnal23NhnIoZG%2Fgiphy.gif%3Fcid%3D790b76113kiff0453lk6r0pgh96ygyjobuwx8qncugwi9wfj%26ep%3Dv1_gifs_search%26rid%3Dgiphy.gif%26ct%3Dg&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExOXNoanBvNTFmMGExc2k3bGNyZXRjcHg4cWl3MnV1amhyZ2UxeG1wcCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F26u6bnal23NhnIoZG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4dd0c510e7054efdf00e61d1b310e3d/href">https://medium.com/media/e4dd0c510e7054efdf00e61d1b310e3d/href</a></iframe><h4>In this article, I will discuss the following errors.</h4><p><strong><em>“Password is not available.</em></strong></p><p><strong><em>Please wait at least 4 minutes after launching an instance before trying to retrieve the auto-generated password.”</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*9VeptRjBr_p1sdoUoGO-3Q.png" /></figure><blockquote><em>“</em><strong>Password is not available.</strong></blockquote><blockquote><strong>The instance was launched from a custom AMI, or the default password has changed. A password cannot be retrieved for this instance. If you have forgotten your password, you can reset it using the Amazon EC2 configuration service.</strong>”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*ziQ7D4VdvypzaJ176PI8Yg.png" /></figure><p><strong>Don’t worry I have a solution. So, let’s get started…….</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6fIT3mShNcekq676%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6fIT3mShNcekq676%2Fgiphy.gif%3Fcid%3D790b761149n81n48q2r0zbapd5nbunc6ujczxxrg102gt3rn%26ep%3Dv1_gifs_search%26rid%3Dgiphy.gif%26ct%3Dg&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExYmxldjl3eXk3MXF2bHRyZDY0amhmaG0wbWRpZWhiMG1ycXl3ZzhuNSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3o6fIT3mShNcekq676%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="246" frameborder="0" scrolling="no"><a href="https://medium.com/media/da350b1df3432e419b924892082957dd/href">https://medium.com/media/da350b1df3432e419b924892082957dd/href</a></iframe><p>When we get the password of the Windows EC2, we know that we need the key pair to get the password for accessing a Windows instance from the “RDP client”. (<em>If you don’t know how to access a Windows EC2server check out my previous article </em><a href="http://How To Create a Windows Server in AWS in simple steps. | by Sankha Gunathunga | Medium)"><em>How To Create a Windows Server in AWS in simple steps. | by Sankha Gunathunga | Medium</em>)</a></p><p>However, it is not easy to access a Windows server if we create the EC2 instance from a custom AMI. (<em>Custom AMI is AMI that we create our own</em>)</p><p>There are two ways to address this issue.</p><ol><li>If we have the parent (<em>Ec2 we created the AMI from</em>) Ec2 password.</li><li>If we don’t have the original Ec2 password.</li></ol><h4>We have the parent Ec2 password</h4><p>If we have the parent EC2 password, this issue is easily resolved. We can use the same password to connect to the new EC2 instance created from the custom AMI.</p><h4><strong>We don’t have the parent Ec2 password</strong></h4><p>If we don’t have the parent EC2 password, resolving this issue requires more effort. Without the original password, we must go through additional steps to access the new EC2 instance created from the custom AMI.</p><p><strong>Create an IAM role</strong></p><p>First, we have to log into the server using “<strong>Session Manager&quot;. </strong>So, for that create an IAM role with an “<strong>AmazonSSMManagedInstanceCore</strong>” and “<strong>AmazonSSMPatchAssociation</strong>” policy attached to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzPpknWRHnjPKHc8VPONfA.png" /></figure><p>Then attach this role to the EC2 instance where we want the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*CqIviMsmt11ZffMUh7rJdw.png" /></figure><p>After attaching the role restart the instance.</p><p><strong>Log into the instance using the session manager</strong></p><p>Now you can log in to the instance using session manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*FXbXrVYyc3jggOi-OPJ4pA.png" /><figcaption>Click to Connet</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjBdnSmxGwMFULhG8x2QBA.png" /></figure><p><strong>Created a Local Admin User and Password to log into the system using the below commands</strong></p><pre>net user /add &lt;USER NAME&gt; &lt;PASSWORD&gt;;<br>net localgroup administrators &lt;USER NAME&gt;/add;</pre><p><em>For demo purposes I used the User name as “scp_temp” and the Password as “Password@123”.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*cn8lScYDgIK-CLC2htuCuA.png" /></figure><p><strong>Now connect to the instance using Fleet Manager using credentials that we used above step</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*Gv0YAPV61vtXjiV5ob9HNQ.png" /></figure><p>Enter the credentials that we created above section and click connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*dz6KP7n5jqhyfxuHvrcqig.png" /></figure><p>Now we successfully logged to the instance using Fleet Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*Xyqt7hDxqQkNQouDX0zdQg.png" /></figure><p><strong>Open a Windows PowerShell as an administrator and ran the following command</strong></p><pre>C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RvNRbUZtVvmYaFdU1zmqSg.png" /></figure><p><strong>Restart the instance and find you can retrieve the password.</strong></p><p>No errors are appearing here now. Put the key pair to Decrypt the Password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*Eta8psHdqCiNzzz2NMQV3A.png" /></figure><p>Now, we can find the password as shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*p7BoiQ-95ssxYQJiKKqkRw.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3ohzdIuqJoo8QdKlnW%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3ohzdIuqJoo8QdKlnW%2Fgiphy.gif%3Fcid%3D790b7611oow0n8fymz82ryncxl41z5zd8dv9umpvyhwvkw8w%26ep%3Dv1_gifs_search%26rid%3Dgiphy.gif%26ct%3Dg&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExMGJlajltOGVsYWRtN3p1d2tlNHBvN3lieTJ4eDExczM4c2gxbDdreSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3ohzdIuqJoo8QdKlnW%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="200" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba6d00cf4a241be6ed7a443b0bedf3f6/href">https://medium.com/media/ba6d00cf4a241be6ed7a443b0bedf3f6/href</a></iframe><p>For more information, please refer to this article for additional details: <br> <a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html#ec2launch-inittasks">https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html#ec2launch-inittasks</a></p><p>In conclusion, it’s crucial to implement a strong password management system to navigate and mitigate these challenges effectively.</p><p><strong><em>Thank you for reading, and if you found it helpful, please clap it to let others know.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d7d8194eb96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting to an Amazon DocumentDB Cluster from an external Public IP]]></title>
            <link>https://aws.plainenglish.io/connecting-to-an-amazon-documentdb-cluster-from-an-external-public-ip-5d6329b71590?source=rss-91d9167dafaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d6329b71590</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[documentdb]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[mongosh]]></category>
            <dc:creator><![CDATA[Sankha Gunathunga]]></dc:creator>
            <pubDate>Wed, 04 Oct 2023 14:59:55 GMT</pubDate>
            <atom:updated>2023-10-11T10:44:48.768Z</atom:updated>
            <content:encoded><![CDATA[<h3>Connecting to an Amazon DocumentDB Cluster from an External Public IP</h3><p>In this article, I will discuss how to access DocumentDB using a public IP. I’m writing this article because DocumentDB does not have a public endpoint by default and also DocumentDB is not intended to be exposed to the internet. They are typically deployed on a private network within a VPC and accessed by applications that are also running on the same VPC.</p><p><strong>“What happens if we want to access the DocumentDB cluster from an external Public IP?”</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fda6mwoW6Cs0DbER02R%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fda6mwoW6Cs0DbER02R%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fda6mwoW6Cs0DbER02R%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0805b4874db843dcc829c3824e37952/href">https://medium.com/media/b0805b4874db843dcc829c3824e37952/href</a></iframe><p><strong>Don’t worry I have a solution. So, let&#39;s get started…….</strong></p><p>First of all, there are some prerequisites you should do before doing this task. There are;</p><ol><li>Create a DocumentDB with Read Replica (Because we are going to put read replica in the public subnet and writer instance in the private subnet)</li><li>Mongosh should be installed into the vm that we publicly accessed.</li><li>Download the “global-bundle.pem” file.</li></ol><p>So if you are done with all prerequisites let’s go to the diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*1PB1gjVIarWQbWvW7RZ28g.png" /><figcaption>Figure 1</figcaption></figure><p>As this diagram shows I’m going to connect NLB in front of Read Replica. Because it is a good practice if we can separate public access and private access. <strong>The idea of a network load balancer coming to this diagram is we can enable a public endpoint for the Read Replica</strong> because as I mentioned earlier by default DocumentDB doesn’t have a public endpoint.</p><p>So, this is the DocumentDB that I created for this task:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTdBTMln7dFafWcBV7JMCA.png" /><figcaption>Figure 2</figcaption></figure><p>This “Primary instance” is in the private subnet and the “Replica instance” is in the public subnet.</p><p>This is the output when we “nslookup” these two instances’ endpoints;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*VqJkK1InK7z54AImlJlcZA.png" /><figcaption>Figure 3</figcaption></figure><p>You can see there is only a private IP attached to the two instances.</p><p>Now I’m going to create a Network Load Balancer and attach the Read Replica to it. Before creating the NLB we have to create the Security group (SG) that going to be put into the NLB (<strong><em>**We have to put public IPs as a source, so I put my IP in the Inbound rule</em></strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3f_sF4x71y4PQr3l7S-SEg.png" /><figcaption>Figure 4</figcaption></figure><p>These are the basic configurations in the Network load Balcacer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k66hM7-UtCA5m4hs85Dggg.png" /><figcaption>Figure 5</figcaption></figure><p>Here (Figure 6) put the subnet that Read Replica created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*yH2__52bEyJCv8-XAozrbQ.png" /><figcaption>Figure 6</figcaption></figure><p>In the security group section put the SG that we created before (Figure 4).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*GbjHviZ3e46U-7KjDllEgQ.png" /><figcaption>Figure 7</figcaption></figure><p>Then create a target group as this figure shows (Figure 8). Put the port as 27017.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*eLwUIHPVUEF9Zqr_2tY6gQ.png" /><figcaption>Figure 8</figcaption></figure><p>The next step is to register the target. So, put the target as the read replicas’ private IP address. I put the target as shown in the nslookup command as this figure shows(Figure 3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLPGDpNiQ0ubcN9_7bv6UA.png" /><figcaption>Figure 9</figcaption></figure><p>Now create the target group and attach it to the load balancer. In the listeners port put as 27017.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41HBqt06q3w5uS4J5g4M_Q.png" /><figcaption>Figure 10</figcaption></figure><p>Create the load balancer and give some time to the target group to become healthy. So, after the target is healthy it shows this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vF4CAUdFghOQiu6ILSM6w.png" /><figcaption>Figure 11</figcaption></figure><p>For the final part of the configurations put the network load balancer’s security group into DocumentDB’s security group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jDRvMlt0WoC6GVbLXP8Zg.png" /><figcaption>Figure 12</figcaption></figure><p>All the configurations are finished. Now let’s test our configurations right or wrong. To do that you have to put a PowerShell command. So, go inside the folder that you have downloaded the “global-bundle.pem” and then enter the below command.</p><pre>mongosh --tls --tlsAllowInvalidHostnames --host &lt;NLB endpoint&gt;:27017 --tlsCAFile global-bundle.pem --username &lt;username&gt; --password</pre><p>Replace the &lt;NLB endpoint&gt; and &lt;username&gt; with your credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIAB_R2G3xz7LToEd348KQ.png" /><figcaption>Figure 13</figcaption></figure><p>So, finally as this figure shows(Figure 13) we successfully connected to the DocumentDB ReadReplica using the public endpoint.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fd2Z4rTi11c9LRita%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fd2Z4rTi11c9LRita%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fd2Z4rTi11c9LRita%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc10956f81005df080d1d079c46088fb/href">https://medium.com/media/dc10956f81005df080d1d079c46088fb/href</a></iframe><p>In short, connecting to an Amazon DocumentDB Cluster using an external public IP is important and doable. By following the steps in this article, you can create a safe and effective connection. This allows you to use DocumentDB for your data needs and build powerful applications that can access your database from anywhere.</p><p><strong><em>Thank you for reading, and if you found it helpful, please clap it to let others know.</em></strong></p><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, and <a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d6329b71590" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/connecting-to-an-amazon-documentdb-cluster-from-an-external-public-ip-5d6329b71590">Connecting to an Amazon DocumentDB Cluster from an external Public IP</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CloudFormation Journey: Part 2 — VPC Peering]]></title>
            <link>https://medium.com/@pramudithasankha/aws-cloudformation-journey-part-2-vpc-peering-8cc669fbfd0f?source=rss-91d9167dafaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cc669fbfd0f</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sankha Gunathunga]]></dc:creator>
            <pubDate>Sun, 27 Aug 2023 08:09:37 GMT</pubDate>
            <atom:updated>2023-08-27T08:09:37.903Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>AWS CloudFormation Journey: Part 2 — VPC Peering</strong></h3><p>Welcome to my second article about my AWS CloudFormation journey. In <a href="https://medium.com/@pramudithasankha/aws-cloudformation-journey-part-1-how-to-create-a-small-aws-network-46f19f169eea"><strong>my previous article</strong></a>, I discussed the basics of AWS CloudFormation and how to create a small AWS network stack. In this article, I will discuss how to use VPC peering with AWS CloudFormation.</p><h4><strong>What is VPC Peering?</strong></h4><p>VPC peering is a networking feature that allows you to connect two VPCs in the same AWS Region or across regions. This allows you to route traffic between the two VPCs as if they were in the same network.</p><p>For example, you could use VPC peering to connect your production VPC with your development VPC. This would allow you to test your production applications in your development environment without having to make changes to your production network.</p><p>You can also use VPC peering to connect your VPC with a VPC owned by another AWS account. This could be useful if you need to share resources between accounts, such as a database or a load balancer.</p><p><strong><em>“So, in this article, we will learn how to create a VPC peering in one account using AWS CloudFormation.”</em></strong></p><p>This is the architecture that we are creating using CloudFormation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*zP3Yl6REBhGif-zbAsWBqw.png" /></figure><p>As this architecture shows, initially we want to create two VPCs, two ec2s, and two route tables. To create these resources, you can refer to my first article “<a href="https://medium.com/@pramudithasankha/aws-cloudformation-journey-part-1-how-to-create-a-small-aws-network-46f19f169eea"><strong>AWS CloudFormation Journey: Part 1 — How to create a small AWS network</strong>.</a>”</p><p>After you create the resources by using my previous article next step is to create the VPC peering. This is the formation code to do that.</p><pre>vpcPeeringConnection:<br>    Type: AWS::EC2::VPCPeeringConnection<br>    Properties:<br>      VpcId: !Ref MyVPC1       <br>      PeerVpcId: !Ref MyVPC2<br>      Tags:<br>      - Key: Name<br>        Value: MyVPCPeering</pre><p>In here you have to replace VpcId names with yours.</p><p>So, after creating this vpc peering connection it shows like this in the AWS console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQ0k4k9mGLs4ptv4Ii8e9g.png" /></figure><p>Then you have to update the routing table. This is how to update the routes.</p><pre>RouteMyVpc2:<br>    Type: AWS::EC2::Route<br>    DependsOn: vpcPeeringConnection<br>    Properties:<br>      RouteTableId: !Ref MyRouteTable2<br>      DestinationCidrBlock: 192.168.0.0/16     #This is the vpc1 cidr range <br>      VpcPeeringConnectionId: !Ref vpcPeeringConnection</pre><p>In the destinationCidrBlock you have to put the opposite side of VPC Cirdr. Same you have to put in the other route table also.</p><pre>RouteMyVpc1:<br>    Type: AWS::EC2::Route<br>    DependsOn: vpcPeeringConnection<br>    Properties:<br>      RouteTableId: !Ref MyRouteTable1<br>      DestinationCidrBlock: 10.0.1.0/16    #This is the vpc2 cidr range <br>      VpcPeeringConnectionId: !Ref vpcPeeringConnection</pre><p>So, now we are going to test whether the connection is established correctly or not. For that, we need to connect to the <a href="https://medium.com/@pramudithasankha/aws-cloudformation-journey-part-1-how-to-create-a-small-aws-network-46f19f169eea">ec2s that we created</a> and check the connectivity using “ping” command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*qSaYzjr4wn0UOTsL-Bh7rA.png" /><figcaption>This screenshot shows connection between 192.168.0.0/16 to 10.0.1.0/16</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*wmOPLwKNLcuKzliK_stCBg.png" /><figcaption>This screenshot shows connection between 10.0.1.0/16 to 192.168.0.0/16</figcaption></figure><p>So now you can see the connection is successful between MyVPC1 and MyVPC2.</p><p><em>The code for this project is hosted on my GitHub account, so if you’d like to see the full code, you can visit my repository and view or download the YAML file from there.</em></p><p><a href="https://github.com/Sankhapramudithagunathuga/Cloudformation.git">https://github.com/Sankhapramudithagunathuga/Cloudformation.git</a></p><p>In conclusion, VPC peering is a powerful networking feature that can be used to connect two VPCs in your AWS environment. When used with AWS CloudFormation, VPC peering can be easily and consistently deployed across your environment.</p><p><em>Keep an eye out for the next article in our AWS CloudFormation Journey series. We’ll be diving even deeper into the world of automating your infrastructure, showing you smart ways to manage your resources and make the most out of your cloud setup.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FmF3Z08f0OjfvwMEFxv%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FmF3Z08f0OjfvwMEFxv%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FmF3Z08f0OjfvwMEFxv%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae93990de7bfbd6994746be84dc00814/href">https://medium.com/media/ae93990de7bfbd6994746be84dc00814/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cc669fbfd0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CloudFormation Journey: Part 1 — How to create a small AWS network.]]></title>
            <link>https://medium.com/@pramudithasankha/aws-cloudformation-journey-part-1-how-to-create-a-small-aws-network-46f19f169eea?source=rss-91d9167dafaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/46f19f169eea</guid>
            <category><![CDATA[cloud-automation]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Sankha Gunathunga]]></dc:creator>
            <pubDate>Sun, 12 Mar 2023 07:30:06 GMT</pubDate>
            <atom:updated>2023-03-12T07:30:06.578Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS CloudFormation Journey: Part 1 — How to create a small AWS network.</h3><p>I am excited to announce the start of my new article series on AWS CloudFormation! CloudFormation is a powerful tool for managing your infrastructure as code in the AWS cloud, and this series will cover a wide range of topics, from the basics of writing CloudFormation templates to advanced techniques for automating your infrastructure deployments.</p><p>In this first article, we will cover the basics of creating a small AWS network using CloudFormation templates. We will walk through the process of defining a Virtual Private Cloud (VPC), subnets, and an Internet Gateway, all using code. Whether you’re new to CloudFormation or an experienced user, this article will give you a solid foundation for creating and managing your infrastructure as code.</p><p>Without further do, let’s dive in and start exploring the power of AWS CloudFormation!</p><p>So, this is the architecture that we are creating using CloudFormation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*Ra8txbx0qddLyhGq4eyDDg.jpeg" /><figcaption>Architecture diagram</figcaption></figure><p>First of all, we have to create the VPC. This is the CloudFormation code for VPC.</p><pre>Resources:<br>  MyVPC:<br>    Type: AWS::EC2::VPC<br>    Properties:<br>      CidrBlock: 10.0.0.0/16  # Edit cird block  <br>      EnableDnsSupport: &#39;true&#39;<br>      EnableDnsHostnames: &#39;true&#39;<br>      Tags:<br>      - Key: Name<br>        Value: MyVPC   # This is the VPC name</pre><p>From this, it will create a VPC that has a 10.0.0.0/16 cidr block and VPC name of “MyVPC”.</p><p>After that, we have to create a public subnet. This is how to create a subnet via CloudFormation.</p><pre>  MyPublicSubnet:<br>    Type: AWS::EC2::Subnet   <br>    Properties:<br>      VpcId: !Ref MyVPC<br>      AvailabilityZone: us-east-1a # Edit availability zone <br>      CidrBlock:  10.0.1.0/24     #Edit subnet block <br>      MapPublicIpOnLaunch: &#39;true&#39;      <br>      Tags:<br>      - Key: Name<br>        Value: MyPublicSubnet  # This is the subnet name</pre><p>So, according to the diagram now we have to create an “Internet gateway”. This is the code for how to create an internet gateway and attach it to the VPC (MyVPC).</p><pre> MyInternetGateway:<br>    Type: AWS::EC2::InternetGateway<br>    Properties:<br>      Tags:<br>      - Key: Name<br>        Value: MyInternetGateway #This is the gateway name <br><br> AttachGateway:<br>    Type: AWS::EC2::VPCGatewayAttachment<br>    Properties:<br>      VpcId:<br>         Ref: MyVPC<br>      InternetGatewayId:<br>         Ref: MyInternetGateway</pre><p>After all, now we have to focus on “Route Tables” and “Routes”. In this example, we give the destination cidr block as “0.0.0.0/0” which is all allowed on the internet.</p><pre>MyRouteTable:<br>    Type: AWS::EC2::RouteTable    <br>    Properties:<br>      VpcId: !Ref MyVPC<br>      Tags:<br>        - Key: Name<br>          Value: MyRouteTable #This is the route table name<br>  <br> RouteTableAssociation:<br>    Type: AWS::EC2::SubnetRouteTableAssociation<br>    Properties:<br>      SubnetId: !Ref MyPublicSubnet      <br>      RouteTableId: !Ref MyRouteTable<br><br> Route:<br>    Type: AWS::EC2::Route<br>    Properties:<br>      RouteTableId: !Ref MyRouteTable<br>      DestinationCidrBlock: 0.0.0.0/0     #This route allows resources to go internet <br>      GatewayId: !Ref MyInternetGateway   #This is the Internet gateway that created the previous </pre><p>We are done with all the networking parts. So now we are going to create an EC2 in this subnet and check the internet connectivity.</p><p><strong>Before that, we have to create a key pair in our console. In this example create a key named “mykeypair”.</strong></p><p>Go EC2&gt; in left-hand go Key Pair under “Network &amp; Security” &gt; Create Key Pair and select “.pem” &gt; download the key pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*Ts7s75hpoanj-1QNOwcPaw.png" /><figcaption>Create a Key Pair</figcaption></figure><p>The next step is to create a security group. This is the CloudFormation code for it. In this example, we allow ssh, http, and https to this security group.</p><pre> MySecurityGroup:<br>    Type: AWS::EC2::SecurityGroup<br>    Properties:<br>      GroupDescription: Allow http, https and ssh<br>      VpcId: !Ref MyVPC<br>      SecurityGroupIngress:<br><br>        - IpProtocol: tcp<br>          FromPort: 22<br>          ToPort: 22<br>          CidrIp:  0.0.0.0/0<br>        <br>        - IpProtocol: tcp<br>          FromPort: 80<br>          ToPort: 80<br>          CidrIp:  0.0.0.0/0<br>        <br>        - IpProtocol: tcp<br>          FromPort: 443<br>          ToPort: 443<br>          CidrIp:  0.0.0.0/0</pre><p>After all, now we can create the ec2 combine with all the network and security configurations.</p><pre>EC2Instance:<br>    Type: AWS::EC2::Instance<br>    Properties:<br>      InstanceType: t2.micro              #Give the intance type of your requirement<br>      ImageId: ami-005f9685cb30f234b      #Give the ami of your requirement(n.virgia,amazon linux)<br>      <br>      KeyName: mykeypair                  #Key pair name that we created manually<br>      SubnetId: !Ref MyPublicSubnet       #Give the Subnet <br>      SecurityGroupIds:<br>        - !Ref MySecurityGroup<br>      Tags:<br>        - Key: Name<br>          Value: Myec2</pre><p>Now we are going to deploy this code to AWS CloudFormation and see the result.</p><p>Go CloudFormation &gt; select stack &gt; Create stack &gt; With new resources (standard)</p><p>Then select Template is ready and in the Specify template field select “Upload a template file” and select the YAML file that you saved.</p><p>In the below figure, you can see the configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFyDrii29tzvzi80sbQdFQ.png" /><figcaption>Create stack</figcaption></figure><p>Then press “Next”. Next, you have to give a stack name. In this example, I’m giving the name “network1&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LM090IIQ5ISituLl0iqMVA.png" /><figcaption>Give a Stack name</figcaption></figure><p>In the next stage (Configure Stack options) creating the stack part leaves the configuration as default and enters next.</p><p>After all, give “Submit”.</p><p>Now we have to check all the configurations are correct.</p><p>These are the resources created in our “network1&quot; CloudFormation stack. You can view them in the Resources tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zKSaO0Arb-ydkKMDz2edA.png" /><figcaption>Recourses that created using CloudFormation</figcaption></figure><p>Now we go and check the ec2 details that we created previously.</p><p>First, we check general details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RU-NIRdbrzCbAECUf1IrbQ.png" /></figure><p>So we can see ec2 in “MyVPC” vpc and “MyPublicSubnet” subnet.</p><p>Secondly, we check security details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Ur11v-KQAeIPAk1BrqlcQ.png" /></figure><p>We can see ssh , http, and https security rules are configured in the security group.</p><p>Finally, in the storage panel, we can see a root volume that contains 8 GB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgHJLLN12DQ0_woXCDM7lw.png" /></figure><p>For the final check, we have to see whether this ec2 instance can access the internet. So for that, we have to ssh to the ec2 and check the connectivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*xQEbJ5h_E7eD7KTtVok_ng.png" /><figcaption>Ec2’s internet connectivity</figcaption></figure><p>So you can see our ec2 instance can access the internet via the Internet Gateway.</p><p><em>The code for this project is hosted on my GitHub account, so if you’d like to see the full code, you can visit my repository and view or download the YAML file from there.</em></p><p><a href="https://github.com/Sankhapramudithagunathuga/Cloudformation.gi">https://github.com/Sankhapramudithagunathuga/Cloudformation.gi</a>t</p><p>In conclusion, AWS CloudFormation is a powerful tool for automating the creation and management of AWS resources. In this article, we’ve seen how to use CloudFormation to create a small network with VPC, subnets, route tables, and an EC2 instance. By defining our infrastructure as code in a CloudFormation template, we can version-control and share our infrastructure configuration, as well as quickly and reliably deploy it across different AWS accounts and regions.</p><p>However, this is just the beginning of our CloudFormation journey. In the next part, we’ll explore more advanced features of CloudFormation, such as parameterization, conditionals, outputs, and nested stacks.</p><p><em>Stay tuned for Part 2 of the AWS CloudFormation Journey, and feel free to leave any feedback or questions in the comments section. Happy CloudFormation-ing!</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F26u4lOMA8JKSnL9Uk%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F26u4lOMA8JKSnL9Uk%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExc3Bxam9kNWk1bWxtcmVyeDV3bDZnZHF4NWVzdnJ0cjY2emJiM3RmYSZlcD12MV9naWZzX2dpZklkJmN0PWc%2F26u4lOMA8JKSnL9Uk%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="322" frameborder="0" scrolling="no"><a href="https://medium.com/media/22b4719199411629c39e1ff30ae52b20/href">https://medium.com/media/22b4719199411629c39e1ff30ae52b20/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46f19f169eea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Create a Windows Server in AWS in simple steps.]]></title>
            <link>https://medium.com/@pramudithasankha/how-to-create-a-windows-server-in-aws-in-simple-steps-d3381b71808a?source=rss-91d9167dafaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3381b71808a</guid>
            <dc:creator><![CDATA[Sankha Gunathunga]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 16:03:16 GMT</pubDate>
            <atom:updated>2023-01-22T16:03:16.252Z</atom:updated>
            <content:encoded><![CDATA[<p>Connect to the AWS Console and Go to EC2 Section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*D1teo-mEEAWv2YB_N0ScbQ.png" /><figcaption>Select Ec2 Section</figcaption></figure><p>Select Launch Instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*y3ZKnOWeUNvqaLIrFxYHwg.png" /></figure><p>After that Select the operating system you want to deploy. In this scenario we select Windows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*Q4-WUVzia1IVxiyplnF8wQ.png" /><figcaption>Select Windows</figcaption></figure><p>Then Create a Key pair</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*X8PE4-WatXQ9f-7x53tDIQ.png" /><figcaption>When we create Key pair give a name and choose “.pem” .Then download the key pair.</figcaption></figure><p>After that, we have to configure the network section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*zFUM6NQKJ9CYOELo3YL4wg.png" /><figcaption>In this blog, we use the default configurations. So, this figure shows select configurations as it is.</figcaption></figure><p>Then select the storage that we want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*4M0gEByMyKIzwd3eqWlgug.png" /></figure><p>After that press “Launch Instance”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*fwMaVKs6lC1-kBjnRt8G0w.png" /></figure><p>Then you can see our windows ec2 creation and it&#39;s in the pending stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*shR_t23yYht6wQycfrh8RA.png" /></figure><p>Now we have to decrypt the password using the private key</p><p>Go to connection in the ec2 panel and select RDP client</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*U_TUDr3f0ySBGjX2b6GSGw.png" /></figure><p>Then select “Get Password”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*U-lZar058EbmKwrl2O6wcA.png" /></figure><p>Select Browse and put the key pair that you downloaded before</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*vfBNcloSp-uf09mbAi9qOw.png" /></figure><p>Then Press “Decrypt password”.</p><p>After that download the remote desktop file.</p><p>Now you can connect to the Ec2 instance via remote Desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*Tj6Uu27C9sXz4SB_vvaDNg.png" /></figure><p>Select Connect for this interface and give the necessary credentials(Username and decrypted password) that shown in the AWS panel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*hL4KVCwDbCyAAZGbRUYm8w.png" /></figure><p>This is the Windows server that we created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*J6ZVGi3GN66HRdkBLyzfAQ.png" /></figure><p><strong><em>Thank you for reading, and if you found it helpful, please clap it to let others know.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3381b71808a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a simple static website using AWS S3]]></title>
            <link>https://medium.com/@pramudithasankha/how-to-build-a-simple-static-website-using-aws-s3-95980941d56?source=rss-91d9167dafaa------2</link>
            <guid isPermaLink="false">https://medium.com/p/95980941d56</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[static-websites]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-s3]]></category>
            <dc:creator><![CDATA[Sankha Gunathunga]]></dc:creator>
            <pubDate>Fri, 22 Jul 2022 16:40:06 GMT</pubDate>
            <atom:updated>2022-07-22T16:40:06.247Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will create a simple “Hello World” static website using AWS S3. It is straightforward and we can deploy a website in less than 5 minutes.</p><p>First of all Login to <a href="http://console.aws.amazon.com/">AWS Console</a> and Go to <a href="https://s3.console.aws.amazon.com/s3/home">S3 Management Console</a>. After that create a new S3 bucket(Click Create bucket).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w0_WxA_-Tl9cS9Nku6MXGw.png" /></figure><p>We have to give a globally unique name in the <strong>Bucket name</strong> field. Otherwise, it will give an error. In this example I used <em>hello-world-static-website-101.</em></p><p>In the <strong>AWS Region</strong> section, we have to select a Region. In this case, I used (<em>N. Virginia) us-east-1.</em></p><p>In the next step(Object Ownership) we have to enable the ACLs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uUCAUOS2gC_AtRyJL0WkKw.png" /></figure><p>In the next step uncheck all to give the public access to the bucket. Click the Next button and Create Bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZCxJn6p-grYMpfHNxtYgA.png" /></figure><p>Then click the correct bucket from the S3 console and select <strong>Upload</strong>. Now select the Html file that you want to upload. (Upload&gt;Add files&gt;Select your file&gt;Upload)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SeSVNx8YpTIkOcqENGa1Rw.png" /></figure><p>This is the sample HTML page that I created. You can edit your HTML page as you wish.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br> &lt;title&gt;Hello World!!!&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br> Hello World!!! <br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>After uploading, the HTML page to the S3 bucket go to the <strong>Properties</strong> tab and Enable <strong>Static website hosting </strong>(It’s at the bottom of the properties section).In the Index document, field put the <em>index.html </em>file you uploaded to the S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*2SnrDRD6FV3-9Y7nLvALDg.png" /></figure><p>Click <strong>Save Changes</strong>.</p><p>Afterward, go to the <strong>Objects</strong> tab of the S3 bucket and select the <em>index.html</em> file. Then go to the Actions and select “Make public using ACL”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w82JqPO0_1kparNjd1S_Dg.png" /></figure><p>Get back to the S3 management console. Go to the <strong>Permissions </strong>tab. Click the <strong>Bucket Policy </strong>button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdgXUginwff3UYmdIa_Dyg.png" /></figure><p>Add the JSON object below to the Bucket policy editor. Do not forget to replace the bucket name on the Resource property with your bucket name.</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: &quot;*&quot;,<br>            &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::<strong>YOUR_BUCKET_NAME_HERE</strong>/*&quot;<br>        }<br>    ]<br>}</pre><p>Click <strong>Save Changes</strong>.</p><p>Now we finished all the configurations. Finally, once again go to the Properties section and go down the page to the Static website hosting. Select the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2n-V4FkuDeI7yv09fMdbQ.png" /></figure><p><strong>Congrats</strong>! Your website is launched in AWS S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfFuJ6j6rXg-TuOjDtkDDA.png" /></figure><p><strong><em>Thank you for reading, and if you found it helpful, please clap it to let others know.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95980941d56" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>