<?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 Pium Sudhara on Medium]]></title>
        <description><![CDATA[Stories by Pium Sudhara on Medium]]></description>
        <link>https://medium.com/@piumsudhara?source=rss-65cb44dde4b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cuf26DJ8gCe1JQXdyQTqMg.jpeg</url>
            <title>Stories by Pium Sudhara on Medium</title>
            <link>https://medium.com/@piumsudhara?source=rss-65cb44dde4b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:50:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@piumsudhara/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[AWS EKS with ArgoCD, Radar & Terraform]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://towardsaws.com/aws-eks-with-argocd-radar-terraform-be835ec99e14?source=rss-65cb44dde4b3------2"><img src="https://cdn-images-1.medium.com/max/2600/1*7B5AKHNPE9u3FsiRJFrcsg.png" width="3394"></a></p><p class="medium-feed-snippet">A practical guide to GitOps-driven Kubernetes deployments with full cluster visibility</p><p class="medium-feed-link"><a href="https://towardsaws.com/aws-eks-with-argocd-radar-terraform-be835ec99e14?source=rss-65cb44dde4b3------2">Continue reading on Towards AWS »</a></p></div>]]></description>
            <link>https://towardsaws.com/aws-eks-with-argocd-radar-terraform-be835ec99e14?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/be835ec99e14</guid>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[radar]]></category>
            <category><![CDATA[gitops]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Sun, 17 May 2026 17:32:11 GMT</pubDate>
            <atom:updated>2026-05-20T09:05:21.099Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Code to Cloud: Automating AWS Infrastructure Deployment with Terraform]]></title>
            <link>https://towardsaws.com/from-code-to-cloud-automating-aws-infrastructure-deployment-with-terraform-788dbf7bec68?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/788dbf7bec68</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[acm]]></category>
            <category><![CDATA[route-53]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Sun, 27 Oct 2024 08:57:59 GMT</pubDate>
            <atom:updated>2024-10-28T06:28:05.307Z</atom:updated>
            <content:encoded><![CDATA[<p>Automate a highly available AWS setup with Terraform, including EC2, S3, ALB, Route 53 for DNS, and ACM for SSL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xh4oyTbNWpjNzXI21-mn-w.png" /></figure><p>Hello readers! Today I’m excited to bring you a new article focusing on building highly available architectures in AWS. Previously, I’ve shared insights on how to work with Terraform, which you can explore here: Infrastructure on AWS with Terraform | by Pium Sudhara | Medium.</p><p>In this article, however, we’ll take a deeper dive into using Terraform to automate the deployment of EC2 instances across private subnets, set up an Application Load Balancer (ALB), configure Route 53 for DNS management, and integrate SSL certificates using AWS ACM. This guide will help you create a secure, scalable, and highly available AWS infrastructure.</p><p>Let’s dive in!</p><p><strong>Amazon Route53</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*jWA7rIKSIF0MFmfHwhSSuw.png" /></figure><p>Amazon Route 53 is a scalable Domain Name System (DNS) web service designed to route end users to applications running on AWS or externally. It enables domain registration, DNS routing, and health checks to ensure reliable and low-latency connections. Route 53 integrates seamlessly with AWS services like ELB, CloudFront, and S3, making it easier to direct traffic to AWS-hosted resources.</p><p>Amazom ACM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*JlyXmIKwWw4BDkeg_wo6Bg.jpeg" /></figure><p>AWS Certificate Manager is a service that simplifies the process of creating, managing, and deploying SSL/TLS certificates for secure web connections. ACM automates the renewal of certificates and integrates directly with services like ALB, CloudFront, and API Gateway, allowing developers to enable secure HTTPS connections without manual certificate management, ensuring data privacy and integrity.</p><h4><strong>Architecture</strong></h4><p>In this architecture, we are leveraging multiple AWS services to create a highly available, secure, and scalable infrastructure across two Availability Zones (AZs) in the <strong>ap-southeast-1</strong> region. This setup is designed to ensure redundancy, fault tolerance, and secure communication for the applications running on EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*4qm9hoiDgvDrZ0tueyzygQ.png" /></figure><p>The <strong>public subnets</strong> serve as the access layer, hosting the <strong>Internet Gateway (IGW)</strong> and <strong>NAT Gateways</strong> with <strong>Elastic IPs</strong>. The Internet Gateway enables external access for resources in the public subnet, while the NAT Gateways provide secure outbound internet connectivity to resources within the private subnets.</p><p>To handle incoming traffic and maintain application performance, an <strong>Application Load Balancer (ALB)</strong> is set up in the public subnet across both AZs, distributing traffic to the EC2 instances in the private subnets based on health and load.</p><p>For secure communication, the architecture incorporates <strong>AWS Certificate Manager (ACM)</strong>, which provisions and manages an <strong>SSL/TLS certificate</strong> applied to the ALB. This SSL certificate ensures that all communication between the ALB and users is encrypted, safeguarding sensitive data during transmission.</p><p>Lastly, <strong>Amazon Route 53</strong> provides DNS management, directing traffic to the Application Load Balancer via a custom domain. This allows users to access the application seamlessly, with Route 53 handling all necessary routing and failover configurations.</p><h4><strong>Code Implementation</strong></h4><p>You can get an idea about the file and folder structure from below image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQJ_DbZu2ywQfn3qGpIbQA.png" /></figure><p>As in the structure I have 3 modules called ALB, EC2 and VPC. Inside every module it has main.tf, outputs.tf and variables.tf files. And this code has root files also.</p><ul><li><strong>main.tf</strong><br>This is the primary file where you define the main resources for your infrastructure. Here, you specify the core AWS resources like EC2 instances, VPCs, subnets, load balancers, etc.</li><li><strong>variables.tf<br></strong>The variables.tf file is where you declare variables that make your Terraform configuration more flexible and reusable. By defining variables, you can easily change inputs like instance types, region, subnet IDs, and other parameters without modifying the main code.</li><li><strong>outputs.tf</strong><br>n outputs.tf, you define outputs for key values that you want Terraform to display after deployment, such as IP addresses, DNS names, or instance IDs.</li><li><strong>backend.tf<br></strong>The file which is where Terraform stores its state file. By default, Terraform stores state locally, but with a backend configuration, you can specify remote storage (e.g., an S3 bucket, Terraform Cloud)</li><li><strong>providers.tf<br></strong>The file in Terraform is where you define and configure the provider settings, specifying the cloud or platform on which Terraform will deploy resources (e.g., AWS, Azure, Google Cloud).</li></ul><p>Root files in Terraform are essential because they serve as the foundational configuration for your entire infrastructure setup. Root files ensure that your Terraform configuration is <strong>structured, reusable, and easily managed</strong>.</p><ul><li>Provide a clear layout of your infrastructure.</li><li>Enable efficient management of inputs and outputs.</li><li>Make deployments adaptable, consistent, and modular, whether deploying a single resource or a complex multi-module setup.</li></ul><p>And inside the scripts folder I have placed file called install.sh, which was shell script used as <strong>user data</strong> on an EC2 instance, running Amazon Linux to set up a basic web server with Apache HTTP (httpd) and display a simple HTML page.</p><h4>Deployment</h4><p>Once the code is implemented execute the following commands. E<strong>nsure that you have created the S3 bucket and Dynamodb table before the deployment.</strong></p><pre>terraform init<br>terraform plan<br>terraform apply -auto-approve</pre><p>Once execute terraform apply it will take few minutes to create the AWS resources. Once creation successful you can check AWS console to verify that our resources are created.</p><p><strong>AWS VPC</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPZ6ZLmPtq4AN19dko-pBQ.png" /></figure><p><strong>Route53</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-Kt4oWC8rhLTmFhJnqnpA.png" /></figure><p><strong>ACM</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEozqMqNKs-VlGtGsb6LuQ.png" /></figure><p><strong>S3</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuKAIh6OHJ4OKvuXlzxEIQ.png" /></figure><p><strong>Dynamodb</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiqA4qsyOyJdxUoLYs0jZw.png" /></figure><p>Once you access your domain name you can see the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PDJf6WTMHA61EPhyq4SRg.png" /></figure><p><strong>Cleanup resources</strong></p><p>Execute following command to cleanup the resources</p><pre>terraform destroy -auto-approve</pre><p>GitHub repo: <a href="https://github.com/piumsudhara/terraform-route53">https://github.com/piumsudhara/terraform-route53</a></p><h4>Overall Outcome:</h4><p>In this article we have created a <strong>highly available, secure, and resilient infrastructure</strong> on AWS, all managed through Terraform’s code-driven approach. It combines best practices in networking, security, scalability, and infrastructure automation. The configuration is designed to support complex applications with high uptime and reliability needs, helping your team deploy faster, manage less manually, and maintain consistent, production-grade deployments across environments.</p><p>In the next article I’ll bring you an interesting topic regarding AWS. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>. <strong>looking forward to your suggestions.</strong></p><p>Thank you all..! Have a great day.. don’t forget to leave a 👏</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*H-b38YJLS-Rw8BmW.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=788dbf7bec68" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/from-code-to-cloud-automating-aws-infrastructure-deployment-with-terraform-788dbf7bec68">From Code to Cloud: Automating AWS Infrastructure Deployment with Terraform</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy AWS Infrastructure with Terraform Cloud and GitHub Actions]]></title>
            <link>https://towardsaws.com/deploy-aws-infrastructure-with-terraform-cloud-and-github-actions-089a78011198?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/089a78011198</guid>
            <category><![CDATA[terraform-cloud]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[aws-infrastructure]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Tue, 19 Mar 2024 12:59:58 GMT</pubDate>
            <atom:updated>2024-03-19T16:15:19.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEi5iSORkZrolGGFACfKuA.png" /><figcaption>Terraform Cloud Workflow: <a href="https://developer.hashicorp.com/terraform/tutorials/cloud-get-started/cloud-sign-up">What is Terraform Cloud — intro and sign up | Terraform | HashiCorp Developer</a></figcaption></figure><p>Hello readers, Today I’m bringing you a new article regarding the most popular services in the DevOps. In one of my previous articles, I have talked about Terraform and how to work with it. If you missed those articles, you could go through with the following links. <a href="https://piumsudhara.medium.com/infrastructure-on-aws-with-terraform-963ab882a5a">Infrastructure on AWS With Terraform | by Pium Sudhara | Medium</a> and <a href="https://piumsudhara.medium.com/provision-aws-eks-cluster-using-terraform-6c9d19de26a2">Provision AWS EKS Cluster using Terraform | by Pium Sudhara | Medium</a></p><p>So, in this article I am not going to talked about the Terraform. In this article I will demonstrate how to deploy an infrastructure in AWS using Terraform Cloud and GitHub Actions and how to manage our infrastructure.</p><p>Let’s get started.</p><h4>What is Terraform Cloud?</h4><p>Terraform Cloud is a hosted service offered by HashiCorp that provides collaboration, automation, and governance features for Terraform users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h2qV185VGChKZLbG.jpeg" /></figure><p>It allows teams to manage their infrastructure as code (IaC) using Terraform. With Terraform Cloud, users can store their Terraform configurations in a central location, share them with team members, and collaborate on infrastructure changes. It provides features like remote execution of Terraform plans and applies, a private module registry, version control integration, and policy enforcement through Sentinel, HashiCorp’s policy as code framework.</p><p>Now let’s deploy our AWS infrastructure using Terraform Cloud.</p><h4>Setup Terraform Cloud Workspace</h4><p>The first step is to setup our Terraform Cloud Workspace. For this you need to go to the <a href="https://app.terraform.io/session">https://app.terraform.io</a> and create an account for you. After that you need to create a new organization. After creating organization, you will have following dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gE4C7td3A7eJjPvBqLGmhA.png" /></figure><p>In here click <strong>API-Driven Workflow </strong>option and create new namespace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NNul5mvFfelYQbTqCs7GhQ.png" /></figure><p>Now we need to set our AWS credentials in our workspace. For this, click <strong>variables,</strong> and then under variables page click <strong>Add variable. </strong>And select variable category as <strong>Environment variable. </strong>In here set your A<strong>WS Access Key ID</strong> and <strong>Access Key.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2BrFqP4CWYvpdD5mmyBC5w.png" /></figure><p>After setting the environment variables last step is to create an API token. This token is requiring authenticating with GitHub and Terraform Cloud. For this task you can click your <strong>profile</strong> and click <strong>Account settings, </strong>and in the tokens, page click <strong>Create and API token</strong>. And make sure to store it safe we are going to use it in next steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vsly08JelmkOmM1CioM-ng.png" /></figure><p>Now our Terraform Cloud configuration is completed. Let’s start with our code implementation.</p><h4>Code Implementation</h4><p>In here we have to setup our application, setup CI/CD workflow, setup AWS and our Terraform code. You can get an idea about the file and folder structure from below image. First create a simple node application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*BtbZmsaPt8kol5r7DPzdlw.png" /></figure><p>After setup the node application run it on locally to confirm that application working properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*S_OkXGQjpVob6N5cBZjoVQ.png" /></figure><p>After application setup is complete let’s configure our Terraform code. As you can see in the file structure, we have 3 Terraform files. main.tf, provider.tf and variables.tf. In the main.tf file I have fully created our AWS environment such as AWS VPC with subnets and security groups, AWS IAM role, AWS ALB, AWS ECS and AWS ECR configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*auigbg-ORWRQQPgUc9W1kw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*M3DIZv1XpNetMEIkM9eLqA.png" /></figure><p>In the provider.tf file you need to have place your configuration from Terraform Cloud. You can simply copy it from your workspace page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*0FNKBVnANHILre_PL0ZiFA.png" /></figure><p>In the variables.tf file you can see that I have place all of the variables that we are going to use for our project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*o9GEWnzyjya8gqUGeqv9Vw.png" /></figure><p>After Terraform configuration completed, let’s focus on setting up aws.json file and aws.tpl file. In the Json file I have configure my AWS ECS configuration. It’s included such as container definition, port mappings, CPU and memory size, volumes, attached ARNs etc. In the template file I have place ECS template variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*l27WXZn7o_eTGABDQHdNug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*kG3YnnkxAA9dWxadJ4H1bw.png" /></figure><p>After configuring the Terraform files, we need to configure the GitHub Actions pipeline. As in the structure, I have created the 2 GitHub workflows for first to create our AWS environment and the second workflow will deploy our application to the created AWS environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*5XFRMJkzEoTejGiR6UwL6Q.png" /></figure><p>After configuring the GitHub workflow, the final configuration is to create our Dockerfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*nvad1PCiK3ZAgFGuQT7PNQ.png" /></figure><p>Now we have completed the code implementation. Let’s configure our GitHub repository. In your newly created Git repository, you need to have following settings.</p><ul><li>The first one is to place your environment variables. In this case you need to place your AWS Key ID, AWS Secret Key and Terraform API that you have copied in the first step.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBdXCSD5Vyxuohdjwih8PQ.png" /></figure><ul><li>The second configuration is to setup the environment rules. In here I have place 3 protection rules. “production-plan” will run the Terraform plan and “production-apply” will run the Terraform apply. This will allow us to review the plan and apply it or deny the plan. And the “production” rule deploys our application to the AWS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-r7qWo8JckIxZLB33dFjVg.png" /></figure><p>So, now we have done all our configurations. Let’s commit and push our changes to see the results.</p><p>If you go to the Actions tab in the GitHub, you will see the following output, that our Terraform plan runs and waiting for review.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*mATI8F8VYQe-Quon_SkcGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Xi-mxZ9fL5AB87zTJ88sw.png" /></figure><p>And if you click approve and deploy, it will the run the Terraform apply and provision our AWS infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*ECvKVLWOr5IaJG8DvxEpwA.png" /></figure><p>This AWS infrastructure provisioning run on the Terraform Cloud platform. If you go the Terraform Cloud dashboard, you will see that all our Terraform commands that runs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZzdZnynhBVO16YrDQ0djZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnmXp9q6MuQyeQHh_S-OIQ.png" /></figure><p>After all the Terraform jobs are completed, our code will trigger the application deployment to the newly created AWS infrastructure. If you expand the “Expose Amazon ALB URL”, it will give you the URL that our application runs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4HyzY6uY0MVJktoZ5yqpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BoaF7a-7_-d6WpdFgjVvzQ.png" /></figure><p><strong>Conclusion</strong></p><p>So, in this short article we have discuss about how to provision a full AWS infrastructure using Terraform Cloud and GitHub Actions, and how to deploy application to the created AWS infrastructure.</p><p>In the next article I’ll bring you an interesting topic regarding AWS. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>. <strong>looking forward to your suggestions.</strong></p><p>Thank you all…! Have a great day. don’t forget to leave a 👏<strong>✌️❤️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*jku_1fS4sT8S5jIU.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=089a78011198" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/deploy-aws-infrastructure-with-terraform-cloud-and-github-actions-089a78011198">Deploy AWS Infrastructure with Terraform Cloud and GitHub Actions</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitLab Runner on AWS]]></title>
            <link>https://piumsudhara.medium.com/gitlab-runner-on-aws-5f80abbb9b16?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f80abbb9b16</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[gitlab-runner]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 13:00:59 GMT</pubDate>
            <atom:updated>2024-02-15T13:00:59.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JpTcfKI9ocHVl4vgYN8ASw.png" /></figure><p>Hello, my fellow readers it’s been a long time that I am bringing you a new article. In this article I am going to talk about how to setup GitLab runner on AWS platform. First let me explain you what this GitLab is and GitLab runners.</p><p><strong>What is Gitlab? </strong>🤔</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mI3uCu9dFCezTsNs29B1bA.png" /></figure><p>GitLab is indeed a widely recognized and popular platform in the IT industry, particularly among software development teams. Its comprehensive set of features for version control, collaboration, continuous integration/continuous deployment (CI/CD), issue tracking, and more. GitLab’s open-source nature also contributes to its popularity, as it allows for flexibility, customization, and community-driven development.</p><p>GitLab’s emphasis on DevOps practices and its ability to integrate with other tools and services further solidify its position as a key player in the software development ecosystem.</p><p>GitLab’s key features include:</p><ul><li><strong>Git Repository Management</strong>: GitLab offers robust Git repository management with features such as branching, merging, and tagging to support collaborative development workflows.</li><li><strong>Issue Tracking</strong>: It provides built-in issue tracking capabilities to help teams manage tasks, bugs, and feature requests efficiently. Users can create, assign, and track issues directly within GitLab.</li><li><strong>Continuous Integration/Continuous Deployment (CI/CD)</strong>: GitLab includes a powerful CI/CD pipeline system that automates the build, test, and deployment processes. It allows developers to define custom pipelines and automate the delivery of their applications.</li><li><strong>Code Review:</strong> GitLab facilitates code review processes with features like merge requests, inline commenting, and code discussions. This helps teams collaborate effectively and maintain code quality.</li><li><strong>Scalability and Flexibility:</strong> GitLab can be deployed on-premises or in the cloud, providing flexibility to organizations with different infrastructure requirements. It offers scalability to support small teams as well as large enterprises.</li></ul><p>Overall, GitLab is a comprehensive DevOps platform that offers a wide range of features and capabilities to support the entire software development lifecycle, from version control and collaboration to continuous integration and deployment.</p><p><strong>What is Gitlab Runner? </strong>🤔</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*-VcpOQ3qAoLL7ENKxF4-Qg.png" /><figcaption>Image Source: <a href="https://dev.to/fkurz/gitlab-cicd-runner-clean-up-with-pre-build-scripts-4b0g">GitLab CI/CD runner clean-up with pre-build scripts — DEV Community</a></figcaption></figure><p>GitLab Runner is an open-source project that is part of the GitLab ecosystem. It is a lightweight, highly scalable agent that runs CI/CD jobs. These jobs can include tasks like building, testing, and deploying code. GitLab Runner can be installed on various platforms including Linux, macOS, and Windows.</p><p>GitLab Runner components:</p><ul><li><strong>Runner Executor:</strong> This component is responsible for running the jobs defined in the GitLab CI/CD configuration. It could be a shell executor, Docker executor, Kubernetes executor, etc.</li><li><strong>Runner:</strong> The Runner is the binary that you install on a machine to enable it to execute jobs. It communicates with the GitLab instance to receive jobs and send back the results.</li><li><strong>Coordinator:</strong> The GitLab instance acts as the coordinator, sending jobs to registered Runners and collecting the results.</li><li><strong>Runner Configuration File:</strong> This file specifies how the Runner should behave, including details like where to send the results, how to execute jobs, which tags to listen to, etc.</li><li><strong>Runner Registration Token:</strong> To connect a Runner to a GitLab instance, you need a registration token. This token is provided by GitLab and ensures that only authorized Runners can execute jobs for a specific project.</li></ul><p>These components work together to automate the execution of CI/CD pipelines defined in the GitLab CI/CD configuration file, providing continuous integration and deployment capabilities for software development projects.</p><p>In the top article I have mentioned that GitLab runner can be install on any platforms. Now let’s configure a GitLab runner on AWS platform. Using AWS to create GitLab runners offers several advantages:</p><ul><li><strong>Scalability:</strong> AWS provides elastic infrastructure, allowing you to easily scale up or down based on your project’s needs. You can configure GitLab runners to dynamically spin up instances when there is a workload and terminate them when not in use, optimizing resource utilization and costs.</li><li><strong>Reliability:</strong> AWS offers a highly reliable infrastructure with redundancy built-in across various services. This ensures that your GitLab runners have high availability, reducing the risk of downtime due to infrastructure failures.</li><li><strong>Integration:</strong> AWS provides integrations with other AWS services such as Amazon EC2, Amazon S3, Amazon ECR, and AWS Lambda. You can leverage these integrations to build robust CI/CD pipelines within GitLab, utilizing AWS services for artifact storage, container registry, serverless computing, and more.</li><li><strong>Managed Services:</strong> AWS offers managed services such as AWS Fargate and AWS Lambda, which abstract away the underlying infrastructure management tasks. You can use these services as GitLab runners to focus more on developing and deploying applications rather than managing infrastructure.</li></ul><p>Overall, using AWS for creating GitLab runners provides flexibility, scalability, reliability, and integration capabilities to streamline your CI/CD workflows and improve the efficiency of your development processes.</p><p>Let’s create a GitLab Runner on AWS.</p><p><strong>Setting up the AWS environment</strong></p><ul><li>First you need to create an EC2 instance. You can create it using console or running following command in AWS CLI.</li></ul><pre>aws ec2 run-instances --image-id &lt;your_image&gt; -count 1 --instance-type t2.micro --key-name &lt;your_keypair&gt; --security-group-ids &lt;your sg&gt; --subnet-id &lt;your subnet&gt;</pre><ul><li>After creating your EC2 instance make sure to it is up and running.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*lzh1tEc9CCeXM31palIL_Q.png" /></figure><ul><li>Now connect to your EC2 instance, and switch to the root user.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*LuBRcWQ-JS_ztkefFHyQyA.png" /></figure><ul><li>Now let’s install components for our instance, using run following commands</li></ul><pre># Install git<br>yum install git -y<br><br># Download GitLab Runner Binary<br>curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64<br><br># Set permissions for GitLab Runner<br>chmod +x /usr/local/bin/gitlab-runner<br><br># Create GitLab Runner user<br>useradd --comment &#39;GitLab Runner&#39; --create-home gitlab-runner --shell /bin/bash<br><br># Install and run <br>gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner<br>gitlab-runner start</pre><p>Now we have config and install the runner into the EC2. Let’s config runner on GitLab.</p><ul><li>Go to your GitLab repository and click settings. Under CI/CD you can see Runners and click expand.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Al5dS_XKlwTDNwX-LJ0NIg.png" /></figure><ul><li>Before creating private runner make sure to disable the public runner by clicking the toggle button. Then click New project runner.</li><li>In the creation page select OS as Linux and add a tag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQsZFxQYtn-KdIlOwZq9kQ.png" /></figure><ul><li>After click create runner, you will get following command. Make sure to copy it and save it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZppjNJwPs3Za_AGcIEyLA.png" /></figure><ul><li>In the runner&#39;s page, you can see our created runner with a warning.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UERHA_17SUda0iygVdjZfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*QAik1eBvYR49_aAeUqLcJg.png" /></figure><ul><li>Now we need configure our runner with EC2 instance. For that go to your EC2 instance and check and GitLab Runner service is up and running. You can run following command for that.</li></ul><pre>gitlab-runner status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOflD5vtZNyGbLr4lze5aQ.png" /></figure><ul><li>Now run the following command that you copied previously.</li></ul><pre>gitlab-runner register --url https://gitlab.com/  --registration-token glrt-FWyVJRcZrL4veCg5x_RU</pre><ul><li>Now you will get following output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kuFFBEu9Sz2lZmLE9HcfcQ.png" /></figure><ul><li>Now go to the GitLab runners page and you can see that our GitLab runner is connect with EC2 instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*lkxtCQq_1QVSctCcc2viAg.png" /></figure><ul><li>Now let’s create a simple gitlab-ci yml to test our GitLab runner.</li></ul><pre>myjob:<br>    stage: build<br>    tags: <br>        - gitlab-runner<br>    script:<br>        - echo &quot;Amazon Web Service&quot;<br>        - hostname</pre><ul><li>Now let’s run our job and you can see the following output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fX4sNAXvEaXm7tD3tn6jQ.png" /></figure><p><strong>Conclusion</strong></p><p>So, in this article we have create our own private GitLab runner on AWS environment. And we have talked about advantages of private GitLab runners.</p><p>In the next article I’ll show you how to integrate Terraform Cloud and AWS. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>. <strong>looking forward to your suggestions</strong></p><p>Thank you all…! Have a great day. don’t forget to leave a 👏<strong>✌️❤️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*EQ2tcJMqIV4pgb5w.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f80abbb9b16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 02]]></title>
            <link>https://towardsaws.com/deploying-a-microservice-into-amazon-elastic-kubernetes-service-part-02-cee4ae68c8bb?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cee4ae68c8bb</guid>
            <category><![CDATA[aws-rds]]></category>
            <category><![CDATA[aws-ecr]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-eks]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 13:07:26 GMT</pubDate>
            <atom:updated>2023-06-14T05:13:02.733Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 02</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*BEHbiAOEAak2ZRzasxFKUQ.png" /><figcaption>Image Source: <a href="https://aws.amazon.com/blogs/opensource/using-pod-security-policies-amazon-eks-clusters/">Using Pod Security Policies with Amazon EKS Clusters | AWS Open Source Blog</a></figcaption></figure><p>In our previous article we have created a bookshop project using NodeJS, ReactJS and store the data in Amazon RDS database, how to simply create a database and work with it. You can read that article through below link. <a href="https://medium.com/towards-aws/deploying-a-microservice-into-amazon-elastic-kubernetes-service-part-01-24ab53ba3b7e">Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 01 | by Pium Sudhara | Jun, 2023 | Towards AWS (medium.com)</a>. But our project was deployed on local machine. In this part let’s deploy our project into cloud using Amazon EKS and ECR.</p><p>I have talked about Amazon EKS and ECR in couple of my articles. So, I am not goanna explain those services on this part. You can refer the below link to get simple idea about Amazon ECR. <a href="https://awstip.com/deploy-react-app-to-aws-fargate-part-01-637c46bd4116">Deploy React App to AWS Fargate — Part 01 | by Pium Sudhara | AWS Tip</a></p><p>Let’s get started.</p><h4>Architecture diagram</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1r-q1FSztTyMsfJCPK5_wQ.png" /></figure><p>So, this our architecture diagram and we have created the RDS. But as I mentioned in previous part, we have created the AWS VPC and RDS are only for testing purpose ensure that our application is working with database. In this part will create the EKS cluster and rest of the AWS services.</p><h4>Amazon EKS setup</h4><p>The first step is to create the EKS cluster. For this step I am using eksctl. If you don’t have install the eksctl cli, you can download it from <a href="https://github.com/weaveworks/eksctl">here</a>. Once you download and install, you can run the following command to create the EKS cluster.</p><pre>eksctl create cluster --name &lt;clusterName&gt; --region &lt;clusterRegion&gt;</pre><p>This command launch <a href="https://aws.amazon.com/cloudformation/">CloudFormation</a> stack to create AWS VPC for the EKS cluster that’s including 6 subnets (3public, 3private) relevant security groups, internet gateway, NAT gateway, and 2 worker nodes for our cluster, etc. This will take up to 10–20 minutes. After creation you can see following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_TXjRmLNX_raa2IpIUagUw.png" /></figure><p>If you go to your AWS console VPC dashboard, you can see the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*GPFqVbYWNwabNAhG6jtTIA.png" /></figure><p>Now our EKS cluster is up and running. Next step is to configure RDS database in our EKS VPC.</p><h4>Amazon RDS setup</h4><p>To create Amazon RDS database you can follow the below steps.</p><ul><li>Go to Databases and click create database.</li><li>In the database creation set the following values<br>- Set as Standard create.<br>- Engine type as MySQL.<br>- Select Free tier.<br>- Set DB instance identifier (In my case I’ll give microcrud).<br>- Set username and password. <strong>Remember to note it down.<br>- </strong>Set the VPC and subnets.<br>- Set the security group and availability zones.<br>- Expand additional configuration and set db name (In my case crudapp)<br>- Then click create database.</li></ul><p>After creating the database make sure to test it out. <strong>And also you need to create the database table that same we created on part 01. For the testing purpose you can simply run a mysql query and add one example.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*rstSYEdcONfKnKk9_5P_gQ.png" /></figure><h4>Amazon ECR setup</h4><p>After creating the RDS database, the next step is to create our container registry that hold our backend and frontend application containers. To do that go to Amazon ECR and create 2 separate registries and name it as “backend” and “frontend”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZYCfYl0vTqYDELX-AmMcA.png" /></figure><h4>GitHub deployment</h4><p>Now we have completed all of the configurations on AWS. Next step is to push our changes into the GitHub. To deploy you need to create and deploy.yaml. You refer mine and do the changes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47b52f8d68795b8f4b8df5cd45bacc65/href">https://medium.com/media/47b52f8d68795b8f4b8df5cd45bacc65/href</a></iframe><p>After configuring the changes on deply.yaml you can simply execute the following commands.</p><pre>git add .<br>git commit -m &quot;Your Commit Message&quot;<br>git push</pre><p>After pushing the changes, you can go to the GitHub and select your repo and click actions you can see that our pipeline is running. In this pipeline first it connects with AWS and verify that credentials are correct.</p><p>Then next step is building our frontend image. After downloading necessary dependencies and it will create a Docker image and push that verified image into the Amazon ECR.</p><p>After pushing the frontend docker image, our pipeline will start to build the backend docker image. And then same as it will push into the Amazon ECR.</p><p>After all of the Docker image pushing to ECR, the pipeline is updating our kubeconfig file and apply the backend-deployment.yaml and backend-service.yaml. After completing the backend deployment into EKS the pipeline is apply the frontend-deployment.yaml and frontend-service.yaml into the EKS. This process will take approximately 2–5 minutes. After deploying you can see the following outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5uYk7wDa6Y-y8Sh6I3Y1A.png" /></figure><p>And if you go to the Amazon ECR, you can see our both of the Docker images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDx0O-6YXNuq94bW3vH97g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kxSygPhI9ba3p3MrPjaEZA.png" /></figure><p>Now all of our configarations and deployments are completed. Now let’s check our running applications. To do that you open the terminal and execute following commands. And these commands give you following outputs.</p><pre>kubectl get deployments<br>kubectl get svc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*EcCBMwsXZSOdcNrni5JNqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOf_YFsyRGyZyAiCs_F0Ow.png" /></figure><p>Now let’s open our application on browser. To do that you can copy the frontend-service load balancer URL and paste it on the browser. And it will give you following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EkWcXpD2Y__LQAwY3sXrw.png" /></figure><p>Now let’s try to add a book.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Fr1lpMMCqadwczCR-5DEA.png" /></figure><p>When give try to add books, you can see there is no response from the application. If you open the dev tools using F12, in the console you can see the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eWqmHGYNbW1SeBWLUs0CEQ.png" /></figure><p>As you can see, we still using the URL as POST method <a href="http://localhost:5000/books">http://localhost:5000/books</a> to add books into our RDS database. Now how to change this.</p><p>You can do simple change. First copy down your load balancer URL for backend service. And then replace all of the URL that starts with <a href="http://localhost:5000/books">http://localhost:5000</a> in the frontend folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*eHfvyoHQhLeLgQu7CzD-7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eMMeaEqrEEgncBbceYaYQQ.png" /></figure><p>After all the changes, push your changes into the GitHub. It will take time to sync up with the deployment. After the deployment you see the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBJMIQHhvvTNL5bxatK9jw.png" /></figure><p>As you can see now our both applications run on AWS without any issues. The most important thing all of our applications are running on private subnet, hence no one can access. It is only accessible by out load balancer only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*SNT_8-f--P_e64IV8OqanA.gif" /></figure><p><strong>Conclusion</strong></p><p>So, in this article we have discuss about EKS, RDS, ECR our project design, how to create a project and connect with the Amazon RDS database, and how to deploy our applications into EKS and connect with the RDS database.</p><p>In the next article I’ll show you how to integrate ArgoCD in our deploy application. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>. <strong>looking forward to your suggestions</strong></p><p>Thank you all…! Have a great day. don’t forget to leave a 👏<strong>✌️❤️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*C0RAQ6KPaWpSlS1eBEwHKw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cee4ae68c8bb" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/deploying-a-microservice-into-amazon-elastic-kubernetes-service-part-02-cee4ae68c8bb">Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 02</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 01]]></title>
            <link>https://towardsaws.com/deploying-a-microservice-into-amazon-elastic-kubernetes-service-part-01-24ab53ba3b7e?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/24ab53ba3b7e</guid>
            <category><![CDATA[aws-ecr]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-eks]]></category>
            <category><![CDATA[amazon-rds]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Sat, 03 Jun 2023 14:09:12 GMT</pubDate>
            <atom:updated>2023-06-05T08:26:47.695Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 01</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*BEHbiAOEAak2ZRzasxFKUQ.png" /><figcaption>Image Source: <a href="https://aws.amazon.com/blogs/opensource/using-pod-security-policies-amazon-eks-clusters/">Using Pod Security Policies with Amazon EKS Clusters | AWS Open Source Blog</a></figcaption></figure><p>Hello everyone, it’s been a long time that I am bringing you a new article regarding containers. In one of my previous article, I have explained about the EKS and how to provision a EKS cluster using Terraform. <a href="https://piumsudhara.medium.com/provision-aws-eks-cluster-using-terraform-6c9d19de26a2">Provision AWS EKS Cluster using Terraform | by Pium Sudhara | Medium</a>. So, in this article I’m going to show you how to deploy microservice into the Amazon EKS. For this little project I am using following tech stack.</p><ul><li>Frontend: ReactJS</li><li>Backend: NodeJS</li><li>Database: Amazon RDS</li><li>Container Registry: Amazon ECR</li><li>Container Orchestration: Amazon EKS</li><li>CI/CD Platform: GitHub Actions</li></ul><p>As you can see for this project, I am using multiple AWS services. Since this is going to be a long article, in this part 01 I will explain about EKS and RDS, architecture design, code implementation and connectivity to Amazon RDS. Hope you are going to love this article.</p><p>Let’s dig in.</p><h4>Amazon EKS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34NrXxLL9CiSCQvtw94QnQ.png" /><figcaption>Image Source <a href="https://aws.amazon.com/eks/">Managed Kubernetes Service — Amazon EKS — Amazon Web Services</a></figcaption></figure><p><a href="https://aws.amazon.com/eks/">Amazon EKS</a> is a managed Kubernetes service to run Kubernetes in the AWS cloud and on-premises data centers. In the cloud, Amazon EKS automatically manages the availability and scalability of the Kubernetes control plane nodes responsible for scheduling containers, managing application availability, storing cluster data, and other key tasks. Applications running on any standard Kubernetes environment are fully compatible and can be migrated to Amazon EKS.</p><h4>Amazon RDS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ge5oUKwZxmjjL8HNzMX0dg.png" /></figure><p><a href="https://aws.amazon.com/rds/">Amazon Relational Database Service (Amazon RDS)</a> is a managed, highly available, and secure database service that makes it simple to set up, operate, and scale relational database management systems (RDBMS) in the cloud.</p><p>Amazon RDS makes it easy to use replication to enhance availability and reliability for production workloads. Using the <a href="https://aws.amazon.com/rds/details/multi-az/">Multi-AZ</a> deployment option, you can run mission-critical workloads with high availability and built-in automated failover from your primary database to a synchronously replicated secondary database. Using <a href="https://aws.amazon.com/rds/features/read-replicas/">Read Replicas</a>, you can scale out beyond the capacity of a single database deployment for read-heavy database workloads.</p><p>Feature of Amazon RDS</p><ul><li>Easy to use</li><li>Amazon RDS Blue/Green Deployments</li><li>Automatic software patching</li><li>Easy storage scaling</li><li>Automated backups</li><li>Database snapshots</li><li>Encryption at rest and in transit</li><li>Network isolation</li><li>Resource-level permissions</li></ul><p>I hope you have idea about the Amazon RDS. Next, I will explain you about the architecture design and code implementation.</p><h4>Architecture diagram</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1r-q1FSztTyMsfJCPK5_wQ.png" /><figcaption><a href="https://github.com/piumsudhara/micro-crud-app/blob/main/Architecture%20design.png">micro-crud-app/Architecture design.png at main · piumsudhara/micro-crud-app (github.com)</a></figcaption></figure><p>As you can see in architecture design, we have a VPC on Singapore region (ap-southeast-1), with two availability zones (ap-southeast-1a, ap-southeast-1b). In the zones we have our EKS cluster and RDS database on private subnets. The reasons why private subnets are often preferred,</p><ul><li>Enhanced Security</li><li>Access Control</li><li>Avoiding Direct Exposure</li><li>Flexibility and Scalability</li></ul><p>Choosing private subnets for the backend services provides increased security, control, and flexibility in managing the application’s network infrastructure.</p><p>For access the application on EKS, we are using Internet Gateway and Application Load Balancer. Load balancers, specifically those with a public-facing component, can play a role in connecting private subnets indirectly. IGW primarily serves as the entry and exit point for internet traffic, it can also be used to establish outbound internet connectivity for resources within private subnets.<br>Overall, the IGW and load balancer, when configured appropriately, can facilitate connectivity between private subnets and the internet, providing a secure and controlled environment for the application’s backend infrastructure.</p><p>And finally using AWS ECR used for container image storage and management. Secure and reliable repository for storing the container images. It simplifies the deployment process, integrates well with other AWS services, and provides scalability and availability for application’s containerized components.</p><p>I hope you have an idea about the architecture design. Now let’s start the coding.</p><h4>Code Implementation</h4><p>First step is to setup our frontend. Then we can proceed with the backend implementation. You can get an idea about the file and folder structure from below image. Now let’s create the React frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*3hnQ4eYfeQNLztzRs5ELPQ.png" /></figure><pre>npx create-react-app frontend<br>cd backend<br>npm start </pre><p>After creating the frontend, you can replace the code with my Git repository code. Go the <a href="https://github.com/piumsudhara/micro-crud-app">piumsudhara/micro-crud-app (github.com)</a> and make sure replace the values. After that execute the last command and you can see our simple frontend in the localhost:3000.</p><p>In the frontend folder there are folder called “public” and inside that folder there is file called “App.js”. That file will catch all our APIs from backend render it the frontend. And we have Dockerfile to dockerize our application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*18cHCVs_CKW1bSFQMX7bdg.png" /><figcaption>Frontend</figcaption></figure><p>Now our frontend implementation is done. Next step is to create the backend and connect it to our frontend. First create a folder called “backend” and inside that folder execute the following command.</p><pre>npm init -y</pre><p>Then inside the backend folder, same as we do in frontend replace the code files in backend. In the backend there are 3 main files.</p><ul><li>db.js — Connect our backend with Amazon RDS</li><li>server.js — Our APIs to connect with frontend.</li><li>Dockerfile — To dockerize our application</li></ul><p>After replacing the code and open the db.js. As you can see in this file there is 4 parameters that you need to replace with your parameters. So how to get those parameters? Now let’s create our RDS database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*IoocjSyvK25KPXTI8Hz_hg.png" /></figure><p><strong>Remember before creating Amazon RDS, we need to create the VPC environment. Since this is test our connection between application and database, I will use default VPC. And also, in the VPC security group you need to allow the MySQL access.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mNVl6RXDYT5uFe3jC9z-iA.png" /></figure><ul><li>After set the inbound rules Open AWS console and go to the AWS RDS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qIsapE2vJnvPLh0chYBTgQ.png" /></figure><ul><li>Go to Databases and click create database.</li><li>In the database creation set the following values<br>- Set as Standard create.<br>- Engine type as MySQL.<br>- Select Free tier.<br>- Set DB instance identifier (In my case I’ll give microcrud).<br>- Set username and password. <strong>Remember to note it down.<br>- </strong>Set the VPC and subnets.<br>- Set the security group and availability zones.<br>- Expand additional configuration and set db name (In my case crudapp)<br>- Then click create database.</li></ul><p>RDS database creation takes roughly 5 minutes. After database created, you can see the details of your database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lydJyxGCkLhwfcrQyE4_zg.png" /></figure><p>Now our database is ready. Now let’s connect our database and backend. To do that open the project folder in VScode. <br><strong>Note: To test the database connection you need install an extension in the VScode.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8tAmaCKMuaawCyUoh7dUuA.png" /></figure><ul><li>Click add connection in the MySQL.</li><li>Set your host name as your RDS endpoint and press enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55ADBuBLIA6kreQICJn9Ow.png" /></figure><ul><li>Set you username, password and enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fICMkL8XWFWbqlEKzsoUHw.png" /></figure><ul><li>Set the port number to 3306. Press enter twice.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8JVGNzwA4xJ8cOgi4hy-g.png" /></figure><p>Now you can see that we have successfully connected our RDS database. You can see the database that we have created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*cxhopYMgo-SBxDYieIbTFA.png" /></figure><p>Now let’s create the table. To do that, right click the database name and click “New Query”. In the query set the follwoing parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*5JzL6lMhkVW-Ilof_ORHAQ.png" /></figure><p>Right click the top of the that file and click “Run MySQL Query”. And you will get following output. If not comes, click refresh top of the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b4pjuSkd8oyJwewRvtHnrg.png" /></figure><p>Now we have create table in our database. Now let’s test our backend and frontend. To do that,</p><ul><li>Open two separate terminals in the VScode.</li><li>Enter below command in the terminals.</li></ul><pre>npm start</pre><ul><li>Now our frontend has open in localhost:3000 address and our backend are running in port 5000.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34Optk8u-drEIYfa6QdGag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*d0R39E799H8xONxen_TC9w.png" /></figure><p>Let’s add a book and see the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWI2KV78c6S5NRxDeAKV7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjQExJWMI_IH7a6kp9f5bA.png" /></figure><p>Yes, yes, yes!!! Our application is running. If you like to test the API, open the postman and check the URLs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsV5fERNDkwjcWpxIzwx1g.png" /></figure><p>That’s it. We have been successfully created an application and connected with the Amazon RDS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*SNT_8-f--P_e64IV8OqanA.gif" /></figure><p>Now our part 01 is done. But it’s in our local machine. How to deploy it to the Amazon EKS? How to access to our deployed application???</p><p><strong>Conclusion</strong></p><p>So, in this short article we have discuss about EKS, RDS, our project design, how to create a project and connect with the Amazon RDS database. But we have test this only in our local machine.</p><p>In the next article I’ll show you how to work with AWS VPC creation, EKS creation, ECR how to manage our application, how to access it, load balancing, etc. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>. <strong>looking forward to your suggestions</strong></p><p>Thank you all…! Have a great day. don’t forget to leave a 👏<strong>✌️❤️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*C0RAQ6KPaWpSlS1eBEwHKw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24ab53ba3b7e" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/deploying-a-microservice-into-amazon-elastic-kubernetes-service-part-01-24ab53ba3b7e">Deploying a Microservice into Amazon Elastic Kubernetes Service — Part 01</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon EKS and ArgoCD]]></title>
            <link>https://awstip.com/amazon-eks-and-argocd-bb954c980cef?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb954c980cef</guid>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[aws-ecr]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[argo-cd]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Fri, 10 Feb 2023 04:34:20 GMT</pubDate>
            <atom:updated>2023-02-10T19:51:08.041Z</atom:updated>
            <content:encoded><![CDATA[<p>Build and Deploy CI/CD Pipeline with Amazon EKS and ArgoCD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJeWStfvM8KiCCYAVFq2eg.png" /><figcaption>Image Source: <a href="https://www.padok.fr/en/blog/cd-argo">Argo CD: focus on the first two CD tools (padok.fr)</a></figcaption></figure><p>“GitOps is an operational framework that takes DevOps best practices used for application development such as version control, collaboration, compliance, and CI/CD, and applies them to infrastructure automation.” — A beginner’s guide to GitOps.</p><p>Hello everyone, so in this article I am going to talk about how to work with Amazon EKS and ArgoCD. First let me explain you what is this GitOps and ArgoCD. So, let’s dig in.</p><p><strong>What is GitOps? </strong>🤔</p><p>As I mentioned in the top of article, GitOps is a code-based infrastructure and operational approach, that based on a Git as a source control system. Application developers are already using the Git and GitOps extends this with application configuration, infrastructure and operational procedures. Let’s say you have Git repository that include application code files, infrastructure and configuration code files that related to your application. When you do the git push, it will trigger the changes and will update your application or the infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epoqp01q15_4Cz120lNTeQ.jpeg" /><figcaption>Image Source: <a href="https://www.weave.works/blog/gitops-is-cloud-native">What DevOps is to the Cloud, GitOps is to Cloud Native (weave.works)</a></figcaption></figure><p><strong>Principles and how to start with Gitops</strong></p><p>According to the CodeFresh, there are 4 principles of GitOps.</p><ul><li>Declarative Configuration</li><li>Version Controlled, Immutable Storage</li><li>Automatic Pull Operations</li><li>Continuous Reconciliation</li></ul><p>To start with GitOps, you need to know about the following practices:</p><ul><li>Git Workflows</li><li>CD Pipelines</li><li>Infrastructure as Code (IaC)</li><li>Tacking and Observability</li><li>Immutable Servers (Containerized Infrastructure)</li></ul><p>You can refer this article from CodeFresh to learn more about the GitOps. <a href="https://codefresh.io/learn/gitops/">What is GitOps? Benefits, Principles, and How to Get Started (codefresh.io)</a>. Next let’s what is ArgoCD.</p><p><strong>What is ArgoCD?</strong>🤔</p><p>Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes applications. It uses the GitOps style to create and manage Kubernetes clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3Rkq8pVkk5-YUi63tpVsw.png" /><figcaption>Image Source: <a href="https://www.giantswarm.io/blog/gitops-with-argocd-giant-swarm">GitOps with ArgoCD » Giant Swarm</a></figcaption></figure><p>The main thing in ArgoCD is it, can pull updated code from Git repositories and deploy it directly to Kubernetes resources. So, can manage both infrastructure configuration and application updates in one system. ArgoCD identifies deployed applications with a live state that deviates from the desired state as OutOfSync, so we can monitor it through the ArgoCD UI and do manually or automatically sync the live state with the desired state.</p><p>So, now I think you have a brief idea about the GitOps and ArgoCD. Let’s create and simple application and deploy to the EKS. Let’s get started.</p><p><strong>Setting up the Application</strong></p><p>First of all, let’s create our application. In this case I will create simple HTML page. And you need to dockerize the above HTML file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40916e0840c7aad126125485684f7bfe/href">https://medium.com/media/40916e0840c7aad126125485684f7bfe/href</a></iframe><ul><li>Then you have to create Helm charts. Helm Chart is a YAML configuration, which defines a package of pre-configured resources that can be deployed in a Kubernetes cluster.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4a09feed0b0f22a0823bea5609a43b3/href">https://medium.com/media/b4a09feed0b0f22a0823bea5609a43b3/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61d6ae96d09aa33ff614d3c070ae44a6/href">https://medium.com/media/61d6ae96d09aa33ff614d3c070ae44a6/href</a></iframe><ul><li>In values.yaml file you can see I have already use my ECR repository. Make sure you have created ECR. Or else you have used your Docker Hub repository.</li><li>Last thing is to configure your workflow or the pipeline. You can configure it through the GitHub or config through the code.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86eda8b93cb2f480d9967d37b11b99c1/href">https://medium.com/media/86eda8b93cb2f480d9967d37b11b99c1/href</a></iframe><ul><li>Now your file structure should like this.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*_wd0JmnBsb8EyD9t3chLLA.png" /></figure><ul><li>After all the configurations, commit your changes and push into the Git. Then our GitHub workflow will run automatically and build and push our image into the ECR.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xJpOrZCPTvKZ_EJNfNY4Q.png" /><figcaption>GitHub Workflow</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aHOZ0FzyM9aHNeh-X0HR4g.png" /><figcaption>Image on ECR</figcaption></figure><ul><li>Now we have setup application. Next is to config our EKS cluster and ArgoCD.</li></ul><p><strong>Configure EKS and ArgoCD</strong></p><p>To setup EKS and ArgoCD I am using Ubuntu on WSL2. You can use following commands to create a EKS cluster and config ArgoCD on the EKS.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9000034d8a2bb8aa7c57cfd4038253d/href">https://medium.com/media/f9000034d8a2bb8aa7c57cfd4038253d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7rSVkEHIpSAaI_syr6hEPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFBbFnCvPBlWqjSsrN6T8g.png" /></figure><ul><li>Once the EKS cluster created and configue the ArgoCD on cluster, let’s create application on ArgoCD.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KFO5FN8EIuEtkWHdozSSHg.png" /></figure><ul><li>Click create application on ArgoCD CLI. And set the following values for the application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQWgzfNd-2nWj23sYwK01g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQm7HXSoUE0cUqfMdfZf5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5CAUPuVM_qIxwu6r1y9wA.png" /></figure><ul><li>Then click create. And you will be redirected into your newly created application on cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tb6Vli23nN3IG07ZSSGRTQ.png" /></figure><p>As you can see our application now on syned and healthy status, let’s check our application on AWS Load Balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jkVKnNfXyRjlnA6nk76sw.png" /></figure><p>Ok, now our application on healthy, let’s do a little change that increase our pods size into 5. To do that need to change the values.yaml on our application and push the changes into Git. Once do the chages we can get following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4CTzNHX8VC75tJVRVapZVg.png" /></figure><p>Now let’s see from the start. We have implemented an application and deploy it to the AWS ECR using GitHub Actions. And using that image we have deployed an AWS EKS cluster with ArgoCD. All the changesa are automatically, and we don’t have to do anything. Everything is automated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*lvGrLpez7RFn68eEWhzf0g.gif" /></figure><p>Ohh, and don’t forget. If you are not going to use the appplication make sure to delete all the resources that you are provisioned. 😉</p><p>Repository: <a href="https://github.com/piumsudhara/ArgoEKS">piumsudhara/ArgoEKS (github.com)</a></p><p><strong>Conclusion</strong></p><p>So, in this article I have talked about what is GitOps, ArgoCD and how to integrate with AWS EKS, ECR and how to with Helm charts on Kubernetes. I hope this article will help you to know about basics about them.</p><p>So, let’s meet in next article. Next, I will come to you with an interesting article. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>. Happy coding!!</p><p>That’s it, thank you all...! don’t forget to leave a 👏<strong>✌️❤️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*C0RAQ6KPaWpSlS1eBEwHKw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb954c980cef" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/amazon-eks-and-argocd-bb954c980cef">Amazon EKS and ArgoCD</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Containers using AWS Copilot]]></title>
            <link>https://awstip.com/deploy-containers-using-aws-copilot-2213e1a81f90?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2213e1a81f90</guid>
            <category><![CDATA[aws-copilot]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-fargate]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Tue, 31 Jan 2023 12:34:58 GMT</pubDate>
            <atom:updated>2023-02-02T15:04:45.686Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ze95tS7uG8QrYOcwmjPhfQ.png" /><figcaption>Image Source: <a href="https://www.workfall.com/learning/blog/how-to-set-up-aws-copilot-to-build-release-and-operate-containerized-applications-on-ecs-and-fargate-using-a-cli-2/">How to set up AWS Copilot to build, release and operate containerized applications on ECS and Fargate using a CLI? — The Workfall Blog</a></figcaption></figure><p>Hello readers, hope you are doing well. It’s been a long time that I am bringing you a new article regarding containers. In this article I will talk about the <a href="https://aws.github.io/copilot-cli/">AWS Copilot</a> and how to work with it. So, let’s get started.</p><p><strong>AWS Copilot</strong></p><p>In 2019 December, AWS has released a preview of new command line interface (CLI) called AWS Copilot. Using this CLI we can easily build, release and manage our containerized applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wmbJCY1VuRVSJpveeH1BBQ.png" /><figcaption>Image Source: <a href="https://aws.github.io/copilot-cli/">AWS Copilot CLI — AWS Copilot CLI</a></figcaption></figure><p>AWS Copilot is an open source CLI, that anyone can use, study, change, and distribute though the worldwide community. When you are going to create an application, you need think about its architecture, and its components such as VPC, Subnets, Load Balancers. The most interesting part of the AWS Copilot is it will handle all underlaying structure for you😮. When I was trying Copilot on first time, I was very impressed about that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMqt-Nf293XFtkCMFhDweQ.png" /><figcaption>Image Source: <a href="https://aws.amazon.com/containers/copilot/">Command Line Interface for Containers — AWS Copilot — Amazon Web Services</a></figcaption></figure><p>Using Copilot you can deploy your containerized applications on AWS ECS, AWS Fargate and AWS App Runner.</p><p>When taking Continuous Delivery on Copilot, you can do multiple deployments into environments on separate AWS accounts and regions using AWS CodePipeline. After all these automated deployments the next question is how to monitor all these? Copilot will help you to monitoring, troubleshooting, debugging your application. You can view your health of the services using the CLI.</p><p>I think you have an idea about AWS Copilot. Now let’s see how deploy the containerized application using Copilot.</p><p><strong>Setting up the application</strong></p><p>First, we need to create an application. In this case I’m gonna use a simple HTML application. And make sure to that you need dockerize the above static HTML application. Or you can use my exiting GitHub repo. <a href="https://github.com/piumsudhara/nodecopilot">piumsudhara/nodecopilot (github.com)</a></p><p><strong>Setting up AWS Copilot</strong></p><p>Before setup the AWS copilot you, make sure you are in the project folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LzLrrJdtdY1u3qSroksvMQ.png" /></figure><ul><li>Type below command to initiate the copilot.</li></ul><pre>copilot init</pre><ul><li>Name your application. In this case I will name it as “nodecopilot”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JY8ERV8OioJzpD7OspNa-w.png" /></figure><ul><li>After naming the application, you need to select the workload type, that going to deploy application. In the list select “Load Balanced Web Service”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I6uaebU-SliA1HC8sHfm3w.png" /></figure><ul><li>Name your service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x4W8-PDRJ-MES2nLdUjc3g.png" /></figure><ul><li>Select your Dockerfile for your load balancer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jttUxpevyzZPh-02GDULEw.png" /></figure><ul><li>After select the Dockerfile, the copilot will begin to create your infrastructure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_hhdQr_aG6iqrKPVyxFXDw.png" /></figure><ul><li>After few minutes copilot will ask you to deploy the application on test environment. Select yes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jueGbMaOHGCAcEO8kS1nlw.png" /></figure><ul><li>This will take sometime to create the environement. As you can see the below image AWS Copilot will handle the infrastructure such as, creating AWS VPC, handling subnets, creating ECS service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1HPEgS8MjCWwhV2SnGwb-A.png" /></figure><ul><li>After few minutes, you will get following message, that deployed service. You can check the link to see your output.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TWm9q0YukQ2fgRQbclo64A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*03hKMekajOR90Tf-XRC4_A.png" /></figure><ul><li>To view your service, you can use below commands.</li></ul><pre>copilot svc show<br>copilot svc status</pre><ul><li>These commands will give you below outputs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMje07Fja_P5jnbz3zzoHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*K7_TjksSL7kwGUAcg6Fc_Q.png" /></figure><p>As I mentioned earlier AWS Copilot will handle all of the AWS resource handling. You can see the AWS resource that are running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nah1bKcvEiLi6S5nk7FDrQ.png" /><figcaption>AWS VPC</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BfIcsOzAK3l1Sfn9Q298Q.png" /><figcaption>AWS ECS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_zsWxtWIX23gY6gXFIoxA.png" /><figcaption>AWS Load Balancer</figcaption></figure><p>That’s it. We have been successfully deploying a containerized application using AWS copilot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*SNT_8-f--P_e64IV8OqanA.gif" /></figure><p><strong>Conclusion</strong></p><p>So, in this short article I have shown you the how to deploy your containerized application using AWS Copilot CLI. Oh, and make sure to clear all your provisioned AWS resources. You can simply use below command to clear all the resources.</p><pre>copilot app delete</pre><p>In the next article I will talk about another interesting service. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>.</p><p>Thank you all...! Have a great day. don’t forget to leave a 👏<strong>✌️❤️</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2213e1a81f90" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/deploy-containers-using-aws-copilot-2213e1a81f90">Deploy Containers using AWS Copilot</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy React App to AWS Fargate — Part 02]]></title>
            <link>https://awstip.com/deploy-react-app-to-aws-fargate-part-02-778d69d2370?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/778d69d2370</guid>
            <category><![CDATA[aws-fargate]]></category>
            <category><![CDATA[aws-ecr]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Mon, 09 May 2022 17:47:59 GMT</pubDate>
            <atom:updated>2022-05-10T08:48:58.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploy React App to AWS Fargate — Part 02</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXEvSINF2Se8R1DQG1CTRQ.png" /><figcaption>Image Source <a href="https://aws.amazon.com/blogs/?awsf.blog-master-category=*all&amp;awsf.blog-master-learning-levels=*all&amp;awsf.blog-master-industry=*all&amp;awsf.blog-master-analytics-products=*all&amp;awsf.blog-master-artificial-intelligence=*all&amp;awsf.blog-master-aws-cloud-financial-management=*all&amp;awsf.blog-master-blockchain=*all&amp;awsf.blog-master-business-applications=*all&amp;awsf.blog-master-compute=*all&amp;awsf.blog-master-customer-enablement=*all&amp;awsf.blog-master-customer-engagement=*all&amp;awsf.blog-master-database=*all&amp;awsf.blog-master-developer-tools=*all&amp;awsf.blog-master-devops=*all&amp;awsf.blog-master-end-user-computing=*all&amp;awsf.blog-master-mobile=*all&amp;awsf.blog-master-iot=*all&amp;awsf.blog-master-management-governance=*all&amp;awsf.blog-master-media-services=*all&amp;awsf.blog-master-migration-transfer=*all&amp;awsf.blog-master-migration-solutions=*all&amp;awsf.blog-master-networking-content-delivery=*all&amp;awsf.blog-master-programming-language=*all&amp;awsf.blog-master-sector=*all&amp;awsf.blog-master-security=*all&amp;awsf.blog-master-storage=*all">AWS Blog (amazon.com)</a></figcaption></figure><p>In our previous article we have dockerize an react app and deploy to the AWS ECR using GitHub Actions. You can read that article through below link. <a href="https://awstip.com/deploy-react-app-to-aws-fargate-part-01-637c46bd4116">Deploy React App to AWS Fargate — Part 01 | by Pium Sudhara | Apr, 2022 | AWS Tip</a>. We have store our image in ECR, now we need to deploy it to the AWS Fargate. First of all let’s seek about AWS Fargate.</p><h3>What is AWS Fargate ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*0XaVw5RxRmdYC6urU010-A.png" /></figure><p>In simply AWS Fargate allows you to run your containers on ECS (Elastic Container Service) without provisioning EC2 instances. AWS Fargate act as an compute engine and manages provisioning, configuring, and scaling clusters to run containers. With AWS Fargate you can easily scale up your container in highly available manner. Even the you can monitor your application using built-in services like Amazon CloudWatch. In Fargate security, workloads are isolation by design. Amazon ECS tasks and Amazon EKS pods run in their own dedicated runtime environment.</p><h3>How does it work?</h3><p>As I mention, AWS Fargate allows you to build and manage applications using serverless containers and works with both ECS and EKS. So how does Fargate works? If you see the below image you can get an idea about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WWQBLhVao-FN_FCrnkPhQg.png" /></figure><p>First, you need to build the container image. Then next need to select a container orchestration service, either Amazon ECS or EKS. Once you are done, the next is to create a cluster and assign resources. Then you can select Fargate launch type and launch your container. In a few simple steps, you can deploy your application.</p><p>We have an idea about AWS Fargate. In our previous article, we have created a react application and deployed it to the AWS ECR using GitHub actions. In today let’s going to deploy that container image into AWS Fargate.</p><p>Let’s get started.</p><h4>Configure task definition</h4><ul><li>Open your AWS console, go to AWS ECS page and click task definitions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTIETAxrxJAEjNArgWFf3Q.png" /></figure><ul><li>In the task definitions, the page creates a new task definition.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLNra44gnLbDo_DY2rp-Kw.png" /></figure><ul><li>In the task definition configurations, you need to provide the task definition family name, container name and the image URL of your container image. And our container port is 80. Then click next.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kztww-R-MMoLpCU0qGwHA.png" /></figure><ul><li>Next is to configure the environment. Select AWS Fargate as App environment, select Linux as OS, and select 1vCPU and 2 GB of memory for task size.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvpOjfF8YK9ZnjUOIp7xfA.png" /></figure><ul><li>(optional) The Amazon CloudWatch is default enabled on the environment page. Then click next to review your configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_muCH32lYiScneIBQPkgfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJa0diOGIR-h0TBP5n0XNQ.png" /></figure><p>We have successfully created our task definition. The next step is to create our cluster.</p><h4>Configure Cluster</h4><ul><li>In the ECS go to Clusters page and click create a cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dwNL_HybX0ohBB7wCymWQ.png" /></figure><ul><li>Give name for your cluster and select VPC, subnets.(I have choose default VPC)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgfynu2PcADoqpP23q4nXA.png" /></figure><ul><li>Then click create. After create the cluster next step is to create the load balancer and target groups.</li></ul><h4>Configure Load balancer</h4><ul><li>Go to EC2 console. In the EC2 Load balancer section create load balancer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWdJEix3QH_np6jUeuHMRA.png" /></figure><ul><li>For the balancer type select Application Load Balancer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5s6iHUmk2WW1rwfvg9kkwA.png" /></figure><ul><li>Let’s config basic configuration. Name your load balancer, for the scheme select Internet-facing, and for the IP address type select IPv4.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5r-CgKQzbx4ywNLvG2h3g.png" /></figure><ul><li>For the network mapping use default VPC and select 2 of the subnets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tq9ALZHnhD6NqJPaFZcTvA.png" /></figure><ul><li>Next is to select the security group. For that I am going to create new security group and config it. Click link to create new security group.</li><li>In the security group name your sg. And in the inbound rules, select type as HTTP and for the source select anywhere. Then click create security group.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dIxrf77KEo3OFRY4w02OJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Eta2V1ygQSUB7JpNNXntw.png" /></figure><ul><li>Now back in the our load balancer page you can see our newly created security group.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9nkvikPOPC1KRf8X9L1XvA.png" /></figure><ul><li>For the target group we need create a new one.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zk2Vf09WeglHYMa4Iobvw.png" /></figure><ul><li>In target group select IP address as type, and provide name, provide protocol and port number as HTTP/8000.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8Avewa3a8hmyn-IBgPUHw.png" /></figure><ul><li>Now back to load balancer page and create Load balancer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKK2woFEJYMdKCmpsfOO_w.png" /></figure><h4>Configure Fargate Service</h4><ul><li>Our next step is to create the Fargate service. Go ECS cluster page services and click create. Before that switch into old version of the AWS console. That will easy to use create the service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5PZz1dc_H_aBJg3B5QZiQ.png" /></figure><ul><li>Select “FARGATE” as launch type, and give an service name. And set number of tasks 3. Then click next.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7oTNPXtwD-wSiurbVjMag.png" /></figure><ul><li>Select your default VPC and choose 2 subnets. Keep the public IP enabled.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ci_HIy9Z9OhInBFlemJGQ.png" /></figure><ul><li>Select Application Load Balancer as type.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlVSJKtO33jrZQN5cXrk8A.png" /></figure><ul><li>Click Add to Load Balancer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dspj33CFRaT8kdhbDAjPmw.png" /></figure><ul><li>Select listener port as 80, select created target group from the dropdown.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JIKZzMHwyp-q7FbfDWZuQ.png" /></figure><ul><li>Then click next and skip the auto scale option. Then create the service.</li><li>Next step is to allow our load balancer to security group. To do that you need to go to security group and put inbound rules. Click security group in service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mANb85dnKPTawWZt6f1wHg.png" /></figure><ul><li>You will be redirect into security group page. Click edit inbound rules.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7aixbOKmJVIwSWGrr4QHjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vUf8iujqA1PN6bfk4MqnQ.png" /></figure><ul><li>Click Add rule and select type as TCP, select source as Custom. And in the range select our created security group. (fargate-react-sg). Then save rules.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiriqwFKrSx78kFHhgCRSQ.png" /></figure><ul><li>Last step is to Go to Load balancer group. And copy the DNS name and paste into into new tab………..</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJpWkf5cG7AKFOoxd_MSjA.png" /></figure><p>That’s it. We have successfully deployed our container image using AWS Fargate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*7P3Ob58uqYoSzYbP2gW9PQ.gif" /></figure><h3>Finally…</h3><p>So, in today we are talked about AWS Fargate, how we are going to deploy container image to the Fargate. In the next article’s let’s talk about more AWS services and also other cloud provider services. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>.</p><p>Thank you all..! Have a great day.. don’t forget to leave a 👏<strong>✌️❤️</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=778d69d2370" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/deploy-react-app-to-aws-fargate-part-02-778d69d2370">Deploy React App to AWS Fargate — Part 02</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy React App to AWS Fargate — Part 01]]></title>
            <link>https://awstip.com/deploy-react-app-to-aws-fargate-part-01-637c46bd4116?source=rss-65cb44dde4b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/637c46bd4116</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ecr]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[aws-fargate]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <dc:creator><![CDATA[Pium Sudhara]]></dc:creator>
            <pubDate>Fri, 22 Apr 2022 08:56:07 GMT</pubDate>
            <atom:updated>2022-04-26T07:00:44.018Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploy React App to AWS Fargate — Part 01</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXEvSINF2Se8R1DQG1CTRQ.png" /><figcaption>Image Source <a href="https://aws.amazon.com/blogs/?awsf.blog-master-category=*all&amp;awsf.blog-master-learning-levels=*all&amp;awsf.blog-master-industry=*all&amp;awsf.blog-master-analytics-products=*all&amp;awsf.blog-master-artificial-intelligence=*all&amp;awsf.blog-master-aws-cloud-financial-management=*all&amp;awsf.blog-master-blockchain=*all&amp;awsf.blog-master-business-applications=*all&amp;awsf.blog-master-compute=*all&amp;awsf.blog-master-customer-enablement=*all&amp;awsf.blog-master-customer-engagement=*all&amp;awsf.blog-master-database=*all&amp;awsf.blog-master-developer-tools=*all&amp;awsf.blog-master-devops=*all&amp;awsf.blog-master-end-user-computing=*all&amp;awsf.blog-master-mobile=*all&amp;awsf.blog-master-iot=*all&amp;awsf.blog-master-management-governance=*all&amp;awsf.blog-master-media-services=*all&amp;awsf.blog-master-migration-transfer=*all&amp;awsf.blog-master-migration-solutions=*all&amp;awsf.blog-master-networking-content-delivery=*all&amp;awsf.blog-master-programming-language=*all&amp;awsf.blog-master-sector=*all&amp;awsf.blog-master-security=*all&amp;awsf.blog-master-storage=*all">AWS Blog (amazon.com)</a></figcaption></figure><p>Over the past few years containerized applications are widely growing technology that helps to build, deploy and mange applications faster. In today there are many container &amp; container orchestration services, that helps to do our activities more efficiency.</p><p>Hello everyone, in this article I’m going to show how we are going to deploy our application with help of 3 different AWS services (AWS ECR, AWS ECS, AWS Fargate). First let’s talk about AWS ECR service.</p><h4>What is AWS ECR ?</h4><p>AWS Elastic Container Registry or aka AWS ECR is a fully managed container registry that you can store, deploy and share your containers very easily. ECR is a very secure, scalable, and reliable service that you can push all your local containers and use them in anywhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1xD0sMyZKoVur4a3tKImGw.png" /><figcaption>Image Source <a href="https://aws.amazon.com/ecr/">Fully Managed Container Registry — Amazon Elastic Container Registry — Amazon Web Services</a></figcaption></figure><p>In ECR you can create one or more repositories in the your registry. Also there is some interesting features in ECR. Image scanning is a one of feature that helps to identify software vulnerabilities in the container. When you are push container image to ECR, it will scan the image and you can retrieve the result scan.</p><p>Now we have an small idea about AWS ECR service. Today I’m going to deploy an react application to AWS ECR service through <a href="https://github.com/features/actions">GitHub Actions</a> service. In one of my previous article I was explained about GitHub Actions you can refer that article through this link, <a href="https://piumsudhara.medium.com/deploy-react-app-into-firebase-using-github-actions-7cc2be88dc60">Deploy React app into Firebase using GitHub Actions | by Pium Sudhara | Medium</a>.</p><p>Let’s get started.</p><h4>Setting up React Application</h4><p>First of all, we need an react application. If you already have GitHub repository you can use it, or else using below command can create new react application.</p><pre>npx create-react-app fargate-react<br>cd fargate-react<br>npm start</pre><pre>//If you are creating new react application, you also need to create a Dockerfile.</pre><p>I am use my existing repository in GitHub.(<a href="https://github.com/piumsudhara/Fargate-React">piumsudhara/Fargate-React: Deploy React Application to AWS Fargate. (github.com)</a>).</p><h4>Configure GitHub Actions</h4><p>As mention in my previous article GitHub Action helps you to build, test, and deploy applications on any platform, including Linux, macOS, and Windows. Easy to automate all your software workflows with world-class CI/CD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYtglIqJQXqO1-hQ4Ny2zA.jpeg" /><figcaption>Image Source <a href="https://docs.github.com/en/actions">GitHub Actions Documentation — GitHub Docs</a></figcaption></figure><ul><li>We are going to use GitHub Actions to build our container image and push it to AWS ECR service using workflow and jobs. Let’s configure GitHub Actions. Go to Marketplace and in the search bar type “AWS ECR” and enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBwTrxI84fsjAeQ-Ym9H_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H314ggUXBn8lpKhx1EoKfg.png" /></figure><ul><li>In the results choose “Amazon ECR Login Action for GitHub Actions”. After copy relevant snippets, go to repository Action section and click configure in simple workflow section, and paste your snippet into yaml file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMl3Kp1HBnKs5K_JlfzSXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zM8RN4gGH-eazrecWqxGCA.png" /></figure><ul><li>You can find my prod-deploy.yaml file in, Fargate-React/.github/workflows directory. In the yaml file I have configured my region as ap-southeast-1 (Singapore), and my repository name as fargate-react.</li><li>Ok, the next step is to import AWS credentials to our repository. To do that go your AWS console’s security credentials section. Then create new Access Key. If you already created, copy your Access Key ID and Secret Access Key.</li><li>Go to repository settings tab. Under security section, click on Actions button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*COuJkDa17miVLesiRhxgLQ.png" /></figure><ul><li>Click “New repository secret”. Then add your AWS credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*kekBxjpjGKVmBWFbtErIpg.png" /></figure><h4>Configure AWS ECR</h4><ul><li>The next step is to configure AWS ECR service to store our container image. Go to AWS console and search “ECR”. Click Get started.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49MKH3MOW0OEwfA_OVbNlg.png" /></figure><ul><li>Choose repository type as Private. For the repository name, please use the name you give in your yaml file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9FCKeW3s3CuIujrqv5jdUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUDFlNVHJwzPVvSaBYG3nQ.png" /></figure><ul><li>The click “Create Repository”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7mSmNZGNsoKeifECsM2Vaw.png" /></figure><p>Ok, now we have successfully create our ECR repository. Next is to commit our code. Then it will start the GitHub Actions. If you go to Actions tab, you will see our pipeline is up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAL68VL0UtmvHFQk8_ZfQA.png" /></figure><p>It will couple of minutes to take complete. As you can see our pipeline is run by Jobs. One Job is completed, it will start the next Job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9gZjSitUkq0XymuOQWX1PA.png" /></figure><p>Ok, Our pipeline is now successfully build our container image and push it to the ECR repository. If you go to the ECR, you can see our container image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wvFshEqOBt393_hCaV6PA.png" /></figure><p>That’s it. We have been successfully build the container image with ECR. Now our work is half done. Next step is to deploy our container image to AWS Fargate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*qwAg3QzKYaQBxlVpulziMQ.gif" /></figure><h4>Finally…</h4><p>So, in today we are talked about AWS ECR and GitHub Actions, how we are going to deploy container images to ECR through a pipeline. In the next article let’s see how to deploy our ECR image to AWS Fargate. If you need any help follow me on <a href="https://github.com/piumsudhara">GitHub,</a> <a href="https://www.linkedin.com/in/pium-sudhara-karunasena-41554458/">LinkedIn</a> or <a href="https://twitter.com/piumsudhara">Twitter</a>.</p><p>Thank you all..! Have a great day.. don’t forget to leave a 👏<strong>✌️❤️</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*C0RAQ6KPaWpSlS1eBEwHKw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=637c46bd4116" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/deploy-react-app-to-aws-fargate-part-01-637c46bd4116">Deploy React App to AWS Fargate — Part 01</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>