<?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 Kanishk Agrawal on Medium]]></title>
        <description><![CDATA[Stories by Kanishk Agrawal on Medium]]></description>
        <link>https://medium.com/@kanishk120?source=rss-c4232d2f113f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*dE9d97RuwjdWF27zWn0GUQ.jpeg</url>
            <title>Stories by Kanishk Agrawal on Medium</title>
            <link>https://medium.com/@kanishk120?source=rss-c4232d2f113f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 07:27:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kanishk120/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[Terraform Pull Request Automation using Atlantis and Infracost]]></title>
            <link>https://medium.com/clairvoyantblog/terraform-pull-request-automation-using-atlantis-and-infracost-864d7a89fd45?source=rss-c4232d2f113f------2</link>
            <guid isPermaLink="false">https://medium.com/p/864d7a89fd45</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Mon, 13 Dec 2021 15:40:26 GMT</pubDate>
            <atom:updated>2021-12-13T15:40:26.549Z</atom:updated>
            <content:encoded><![CDATA[<h4>Automating your Terraform Pull Requests and Review Workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*Adt_OBT5au8ddiRLsWBc8g.jpeg" /><figcaption>Atlantis and Infracost with Azure DevOps</figcaption></figure><p>Terraform has become a major tool for DevOps and Software Engineers to automate workflows and infrastructure deployment to the cloud. This Infrastructure as Code (IAC) tool has made the process of provisioning resources very quick and simple. An engineer needs to run a terraform plan to verify the changes and terraform apply to make those changes live.</p><p>For an individual or a small team, this workflow works just fine. But when you’re working with a large team of engineers, managing all the changes and pull requests (PRs) becomes very difficult. Some of the challenges faced are -</p><ol><li>Multiple team members should have correct permissions to run a terraform plan and apply</li><li>On a PR, you need to attach the output of a plan to get it reviewed by the approver</li><li>Different engineers may have different versions of Terraform on their machines</li></ol><p>Another important aspect of infrastructure deployment is the cost associated with different resources. Calculating cost estimates for the infrastructure is done manually through external tools and sometimes cost mismanagement results in breached bills. Knowing the cost estimates for the changes being made is still a challenge. To tackle the above challenges, we’re going to use Atlantis and Infracost.</p><h3><strong>Atlantis</strong></h3><p>Atlantis is a Terraform pull request automation tool that automates the process of running <em>terraform plan</em> and <em>terraform apply</em>. When a pull request gets updated, Atlantis runs a plan on the folder containing changes and attaches a comment on the PR with the output of the plan. When you want to apply the changes, you need to comment <em>atlantis apply</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*38NJy81_1czJ16AVhq04NA.png" /><figcaption>Atlantis Terraform workflow — <a href="https://medium.com/runatlantis/introducing-atlantis-6570d6de7281">https://medium.com/runatlantis/introducing-atlantis-6570d6de7281</a></figcaption></figure><h4><strong>Features</strong></h4><ul><li>Increased visibility</li><li>Better collaboration</li><li>Review terraform PR better</li><li>Standardize workflow</li></ul><h3><strong>Infracost</strong></h3><p>Infracost shows cloud cost estimates for infrastructure-as-code projects such as Terraform. It helps DevOps, SRE, and developers to quickly see a cost breakdown and compare different options up front. Infracost helps developers and DevOps engineers get cost estimates from their IAC. Infracost CLI finds supported resources from the Terraform plan file and uses cost-related parameters, such as instance type, to calculate the overall cost of the resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jR9lrBMvm5v6iVilrNcd-w.png" /><figcaption>Atlantis with infracost — <a href="https://www.infracost.io/docs/integrations/cicd/#atlantis">https://www.infracost.io/docs/integrations/cicd/#atlantis</a></figcaption></figure><h3><strong>Deploying Atlantis and Infracost with Azure DevOps</strong></h3><h4>Pre-requisites</h4><ol><li>Azure account</li><li>Azure DevOps organization</li><li>Azure git repository</li></ol><p><strong>Step 1:</strong> Create a personal access token for Atlantis to connect to your Azure DevOps organization.</p><p>a) Sign in to your Azure DevOps organization. From User settings, select personal access tokens.</p><p>b) Click on <em>+New Token</em> to create a new pat token.</p><p>c) Enter a name for your token. Under scopes, choose custom defined and check the <em>Code:Read&amp;Write</em> checkbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*aggkhNcZPLwCWvEjSPRC5A.png" /></figure><p>d) Click on <em>Create</em> to create the token. Copy the token value and make sure you save it somewhere safe.</p><p><strong>Step 2: </strong>Create an Infracost API key from <a href="https://www.infracost.io/docs/#2-get-api-key">here</a>.</p><p><strong>Step 3: </strong>Deploy Atlantis + Infracost as a docker container using Azure Container Instances(ACI).</p><p>a) Go to your Azure portal and search for azure container instances</p><p>b) Click on <em>+Create</em> to deploy an azure container.</p><p>c) Enter details for your container -</p><ul><li>Resource-group name: atlantis-rg</li><li>Container name: atlantis</li><li>Region: eastus</li><li>Image name: infracost/infracost-atlantis</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*VGRiwCtEu0TCmck25-MvyA.png" /></figure><p>d) Click next on networking -</p><ul><li>Networking type: Public</li><li>DNS label: atlantis-demo-124</li><li>Ports: 4141(TCP)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*fFT22g50YxsOwl4KVYk8Ew.png" /></figure><p>e) Click next on Advanced -</p><ul><li>Environment variables</li></ul><pre>ATLANTIS_AZUREDEVOPS_USER = KAgrawal0841</pre><pre>ATLANTIS_AZUREDEVOPS_TOKEN = YOUR_PAT_TOKEN</pre><pre>ATLANTIS_REPO_ALLOWLIST = dev.azure.com/{YOUR_AD_ORG}/{YOUR_AD_PROJECT}/{YOUR_AD_REPO}</pre><pre>ATLANTIS_ATLANTIS_URL = <a href="http://{your_container_fqdn}/">http://{YOUR_CONTAINER_FQDN}</a></pre><pre>ATLANTIS_REPO_CONFIG_JSON = {<br> “repos”: [<br>   {<br>     “id”: “/.*/”,<br>     “workflow”: “atlantis-infracost”<br>   }<br> ],<br> “workflows”: {<br> “atlantis-infracost”: {<br>   “plan”: {<br>      “steps”: [<br>        “init”,<br>        “plan”,<br>        {<br>          “env”: {<br>            “name”: “INFRACOST_API_KEY”,<br>            “value”: “{YOUR_INFRACOST_API_KEY}”<br>          }<br>        },<br>        {<br>          “run”: “/home/atlantis/infracost_atlantis_diff.sh”<br>        }<br>      ]<br>    }<br>  }<br> }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*V880qeSv9LWXifCh9qH6lg.png" /></figure><p>f) Click on <em>review+create</em>. Once validation is passed, click on <em>create</em>.</p><p>g) Once deployed, from a browser, go to your container’s FQDN to see it running. Ensure you enter the prefix, http:// in front of aci-demo… string and the port 4141 in the end</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mquc5AzUZ-40fqhqP4Dfow.png" /></figure><p><strong>Step 4: </strong>Create webhooks to trigger Atlantis on every PR change.</p><p>a) Go back to your Azure DevOps organization and click on <em>project settings</em>.</p><p>b) From the menu, select service hooks. Click on <em>+New Subscription</em> and select webhooks from the menu and click <em>Next</em>.</p><p>c) Select <em>Pull request created</em> from the drop-down menu as the trigger event. Enter required details about your repository and click <em>Next</em>.</p><p>d) Under URL, enter your Atlantis URL as <a href="http://{azure_container_fqdn}:4141/events">http://{Azure_Container_FQDN}:4141/events</a> . Leave rest as default. Click on <em>Test</em> to test your connection. Once verified, click on <em>Finish</em> to create the webhook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*KAFjhyDl-FJniIy08ua4lA.png" /></figure><p>e) Repeat the same steps to create webhooks for <em>Pull Request Updated</em> and <em>Pull Request Commented On</em>.</p><p><strong>Step 5:</strong> Go to your git repository and try pushing new changes and create a new pull request. A comment should be posted on your PR by Atlantis. Expand the output to see the execution plan and total cost associated with your resources.</p><blockquote>Atlantis is now running!</blockquote><p>Congratulations! You have successfully automated Terraform pull requests by deploying Atlantis and Infracost with Azure DevOps.</p><h3>References</h3><ul><li>Atlantis: <a href="https://www.runatlantis.io/">https://www.runatlantis.io/</a></li><li>Infracost: <a href="https://www.infracost.io/">https://www.infracost.io/</a></li><li>MS Learn: <a href="https://docs.microsoft.com/en-us/learn/modules/run-docker-with-azure-container-instances/1-introduction">Introduction — Learn | Microsoft Docs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=864d7a89fd45" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clairvoyantblog/terraform-pull-request-automation-using-atlantis-and-infracost-864d7a89fd45">Terraform Pull Request Automation using Atlantis and Infracost</a> was originally published in <a href="https://medium.com/clairvoyantblog">Clairvoyant Blog</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 Web application on Azure App Service using Terraform and Azure Pipelines]]></title>
            <link>https://medium.com/@kanishk120/deploying-a-web-application-on-azure-app-service-using-terraform-and-azure-pipelines-bffb344a7e15?source=rss-c4232d2f113f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bffb344a7e15</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-devops]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Sun, 27 Sep 2020 17:17:28 GMT</pubDate>
            <atom:updated>2020-09-27T17:54:14.504Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*L1kaBgE5d-UdMuNx3lLcaw.png" /></figure><p>This tutorial shows how to deploy a containerized ASP.NET webapp on Azure App Service using Terraform and Azure Pipelines.</p><h4>Prerequisites</h4><ul><li>Azure Subscription</li><li>Azure DevOps Organization</li><li>GitHub account</li></ul><h4>Getting started</h4><p>Step 1: Fork a git repository from <a href="https://github.com/MicrosoftDocs/mslearn-deploy-run-container-app-service">here</a>. It contains a sample containerized ASP.NET web application.</p><p>Step 2: Add a Terraform configuration file <strong>main.tf</strong> to it. Replace &lt;resource-group&gt; and &lt;location&gt; with appropriate values.</p><pre>terraform {  <br>  backend &quot;azurerm&quot; {<br>    }<br>}<br>provider &quot;azurerm&quot; {<br>  features {}<br>}<br>resource &quot;azurerm_app_service_plan&quot; &quot;main&quot; {<br>  name                = &quot;docker-asp&quot;<br>  location            = &quot;&lt;location&gt;&quot;<br>  resource_group_name = &quot;&lt;resource-group&gt;&quot;<br>  kind                = &quot;Linux&quot;<br>  reserved            = true<br>  <br>  sku {    <br>    tier = &quot;Standard&quot;<br>    size = &quot;S1&quot;<br>  }<br>}<br>resource &quot;azurerm_app_service&quot; &quot;main&quot; {<br>  name                = &quot;docker-app-service&quot;<br>  location            = &quot;&lt;location&gt;&quot;<br>  resource_group_name = &quot;&lt;resource-group&gt;&quot;<br>  app_service_plan_id = &quot;${azurerm_app_service_plan.main.id}&quot;<br>}</pre><p>If you are new to Terraform, then check out my another blog from <a href="https://medium.com/@kanishk120/getting-started-with-terraform-on-microsoft-azure-50b2fa2e8eb1?source=friends_link&amp;sk=302a3731dd8f0bcc9fcf2d9dbf9285ae">here</a>.</p><h4>Creating Azure Storage Account and Container Registry</h4><p>Step 1: Head over to your <a href="https://portal.azure.com/">Azure portal</a>. Open your Azure Cloud Shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*q-k2CDjUCAKc4UHzUONKxA.png" /></figure><p>Step 2: Run the following <em>az group create</em> command to create a resource group named <strong>tf-example</strong>.</p><pre>az group create \<br> --location eastus \<br> --name tf-example</pre><p>Step 3 : Run the following <em>az storage account create</em> command to create a storage account named <strong>tfex120</strong>.</p><pre>az storage account create \<br> --name tfex120 \<br> --resource-group tf-example \<br> --sku Standard_LRS</pre><p>Step 4 : Run the following <em>az storage container create</em> command to create a storage container named <strong>tfexc120</strong> in your storage account.</p><pre>az storage container create \<br> --account-name tfex120 \<br> --name tfexc120</pre><p>Step 5: Run the following <em>az acr create</em> command to create a Azure Container Registry.</p><pre>az acr create \<br> --name acr125 \<br> --resource-group tf-example \<br> --sku standard</pre><h4>Setting up your Azure DevOps Environment</h4><p>Step 1: Head over to <a href="https://azure.microsoft.com/en-in/services/devops/">Azure DevOps</a>. Sign in to your Azure DevOps account. Create a project from <strong>Create New Project </strong>page, select your organization and then enter a name for your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*SvBeOY9o72Z4A_1hDBveVw.png" /></figure><p>Step 2: In your project, select <strong>Pipelines</strong>. Under Pipelines, select <strong>Releases</strong>.</p><p>Step 3: Under Releases, click on <strong>New Release</strong>.</p><p>Step 4: On Select a template pane, select <strong>Start with empty job</strong>. Give a name to your Stage.</p><p>Step 5: Click on <strong>+Add an artifact</strong>. Select GitHub as source. Add a new service connection by clicking on <strong>+New</strong>. Select your forked repository.</p><p>Step 6: Fill in your project name, repository name and other details. Click Add.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWmMkkX9m0u1a_O8fQg5zw.png" /></figure><p>Step 7: Click on the lightning bolt symbol. Enable Continuous Deployment trigger.</p><p>Step 8: Click on Stage1 and rename it to Docker Build. Click on Job to add tasks. Select <strong>Ubuntu 18.04</strong> as Agent Specification. Next click <strong>+</strong> on Agent Job option to add a tasks.</p><p>Step 9: In the search box, search for Docker and add <strong>Docker CLI Installer</strong> task and <strong>Docker task</strong>.</p><p>Step 10: Fill in the required details. For Container Registry, choose <strong>Azure Container Registry</strong>. Set the command to <strong>buildAndPush</strong> and click on <strong>Save</strong>. It should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nigXBYhRS61-Yl5CiZrPug.png" /></figure><p>Step 11: Go back to your release pipeline. Click on <strong>+Add</strong> to add a new stage. Rename this stage to Terraform IAAC. Click on Job to add tasks. Select <strong>Ubuntu 18.04</strong> as Agent Specification. Next click <strong>+</strong> on Agent Job option to add a tasks.</p><p>Step 12: In the search box, search for Terraform. If Terraform extension is not already installed, then install it.</p><p>Step 13: From the search pane, add task Terraform tool installer and 2 Terraform tasks.</p><p>Step 14: Select first Terraform: azurerm task. Change Display name to “Terraform : init”. Change Configuration Directory to the directory where your files are saved.</p><p>Step 15: Provide AzureRM backend configuration details. Select your Azure Subscription. Enter the name of the resource group, storage account and storage container that we created earlier and Click Save.</p><p>Step 16: In the same way, fill in the details for second Terraform: azurerm task. Change Display name to “Terraform : apply”. Change your Configuration Directory.</p><p>Step 17: Change the command to “validate and apply”. Under additional command arguments, provide “-auto-approve -input=false”. Select your Azure Subscription And Click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMozYk7iix7P7-_kgrtWBQ.png" /></figure><p>Step 18: Again, go back to your release pipeline. Click on <strong>+Add</strong> to add a new stage. Rename this stage to Azure App Service Deployment. Click on Job to add tasks. Select <strong>Ubuntu 18.04</strong> as Agent Specification. Next click <strong>+</strong> on Agent Job option to add a tasks.</p><p>Step 19: In the search box, search for Azure App Service and add <strong>Azure App Service Deploy</strong> task.</p><p>Step 20: Fill in the required details. Change App Service Type to <strong>Web App for Containers (Linux)</strong>. The app service name should be same as you had given in main.tf file. Click on <strong>Save</strong>. It should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNjJiR5bZyYLargkv2MpBA.png" /></figure><p>Step 21: Click on <strong>Create release</strong> to start your release pipeline. Once all the stages get completed, head over to <a href="https://portal.azure.com/">Azure portal</a> to check your resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ihu3dEk1Sk3K9DxyqelSQ.png" /></figure><p>Step 22: Go to your Azure App Service. Click on browse to check your webapp.<br>Note: Since it will be the first time, so it may take a little more time to load.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2p4NfivHDzqbqozk2rm0A.png" /></figure><p>Congratulations! You’ve successfully deployed a containerized web application using Terraform and Azure Pipelines.</p><h4>References</h4><ul><li>Microsoft docs — <a href="https://docs.microsoft.com/en-us/learn/modules/deploy-run-container-app-service/">https://docs.microsoft.com/en-us/learn/modules/deploy-run-container-app-service/</a></li><li>Azure DevOps Labs — <a href="https://azuredevopslabs.com/">https://azuredevopslabs.com/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bffb344a7e15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Terraform on Microsoft Azure]]></title>
            <link>https://medium.com/@kanishk120/getting-started-with-terraform-on-microsoft-azure-50b2fa2e8eb1?source=rss-c4232d2f113f------2</link>
            <guid isPermaLink="false">https://medium.com/p/50b2fa2e8eb1</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[linux-virtual-machine]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 13:18:36 GMT</pubDate>
            <atom:updated>2020-09-07T13:18:36.919Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*AMQVlWCFm2DSKewN9BoEyA.png" /></figure><p>Availability of infrastructure has become much easier for everyone. One just has to access any of the cloud service and they can get the infrastructure that they require. But the manual process of creating infrastructure takes a lot of time. To automate this process and decrease the overall time, we use Infrastructure provisioning tools like Terraform.</p><h4>What is Terraform?</h4><p>According to <a href="https://www.terraform.io/intro/index.html">terraform.io</a>,</p><blockquote><em>“Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.”</em></blockquote><p>Terraform is an open-source infrastructure as code software tool created by <a href="https://www.hashicorp.com/">HashiCorp</a>. Users define and provision datacenter infrastructure using a declarative configuration language known as HashiCorp Configuration Language (HCL), or optionally JSON.</p><h4>Why to use Terraform?</h4><ol><li>Provisioning tool rather than management tool.</li><li>Creates immutable infrastructure.</li><li>Declarative language</li><li>Masterless</li><li>Agentless</li></ol><h4>Creating a Linux VM on Azure using Terraform</h4><p>The very first step to start using Terraform on Azure is to go to your cloud shell on Azure portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1W96-tKuqezPzH-HyxBXQ.png" /></figure><p>Step 1: Login to your current Azure account</p><pre>$ az login</pre><p>Step 2: Change directory to mounted file share where your work in Cloud Shell is persisted. Create another directory “terraformtutorial” and change to your demo directory.</p><pre>$ cd clouddrive<br>$ mkdir terraformtutorial<br>$ cd terraformtutorial</pre><p>Step 3: Create Terraform configuration files and add the resources that you want to create.<br>Let’s first create our file where we will define all the variables i.e. vars.tf</p><pre>$ code vars.tf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*_GP-rV4ijMjs_UuQVjqtgQ.png" /></figure><p>Next is the file where we are going to store the values of our variables. Replace <em>&lt;ResourceGroupName&gt;, &lt;LocationName&gt;</em> and <em>&lt;VirtualMachineName&gt;</em> with the values that you want.</p><pre>$ code values.tfvars</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QkxPQlZ_IA3j43fQWqXd5A.png" /></figure><p>Finally, let’s create our main.tf configuration file where we’ll define all the resources.</p><pre>$ code main.tf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMh7VRrb4ixSxEh2Cy7I-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMsD3i5ylj0Fy4KIz31Fbw.png" /></figure><p>Step 4: Initialize the Terraform deployment with Terraform init. This downloads all the modules that are required to create Azure Resources.</p><pre>$ terraform init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*SIRPoaqHWSc3tF7qxAij3A.png" /></figure><p>Step 5: Run terraform plan to create an execution plan from your Terraform configuration file.</p><pre>$ terraform plan -var-file=&quot;values.tfvars&quot;</pre><p>Step 6: Run terraform apply to apply the execution plan.</p><pre>$ terraform apply -var-file=&quot;values.tfvars&quot;</pre><p>Step 7: SSH to your Linux VM.</p><pre>$ az vm show --resource-group &lt;ResourceGroupName&gt; --name &lt;VirtualMachineName&gt; -d --query [publicIps] -o tsv<br>$ ssh azureuser@&lt;publicIps&gt;</pre><p>Congratulations! You have successfully deployed a Linux VM on Azure using Terraform.</p><h3>References</h3><ol><li>Microsoft docs — https://docs.microsoft.com/en-us/azure/developer/terraform</li><li>Terraform — https://www.terraform.io/docs/index.html</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50b2fa2e8eb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Containers?]]></title>
            <link>https://medium.com/@kanishk120/what-are-containers-eeb2275f2062?source=rss-c4232d2f113f------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeb2275f2062</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Sun, 10 May 2020 13:00:15 GMT</pubDate>
            <atom:updated>2020-05-10T13:00:15.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_T1zpukE7wfjioCZIF32A.jpeg" /></figure><p>Containers are application-centric methods to deliver high-performing, scalable applications on any infrastructure. These are used to deliver microservices by providing portable, isolated virtual environments for applications to run without interference from other running applications.</p><p>According to docker.com,</p><blockquote>“A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2QfOAl_JeHPuPilwlnwodQ.jpeg" /></figure><h3>Why use a container?</h3><p>A container is immutable - the unchanging nature of a container allows it to be deployed and run reliably with the same behaviour from one compute environment to another. A container is light-weight and we can run multiple containers on single compute environment. Due to small size, it starts-up fast in few seconds instead of minutes. It makes it easy to get a software to run reliably in different environments like QA, testing and production as it containerizes the application software and its dependencies.</p><h3>Containers vs Virtual Machines</h3><p>Containers are often confused with Virtual Machines. But containers and virtual machines are two different technologies. The main difference between Container and VM is that Container provides OS-level virtualization whereas VM provides hardware-level virtualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*0LIo2dPWiedwQGLG76pzXg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*xVXdN-xa28ij6qHMOHjZsQ.jpeg" /></figure><h3>What is container image?</h3><p>Containers encapsulate microservices and their dependencies but do not run them directly. Containers run container images. A container image encapsulates the application along with its runtime and dependencies, and a container is deployed from these images. Containers can be deployed from a specific image on many platforms such as workstations, Virtual Machines, cloud, etc.</p><p>A container image is immutable. Once you’ve built an image, it can’t be changed. The only way to change an image is to create a new one.</p><h3>Benefits of containers</h3><ul><li>Improves scalability and lower cost: containerization increase scalability from 10 to 100 times as compared to VMs environment, so it also helps in reducing cost.</li><li>No more hypervisors</li><li>It provides greater modularity. We can split an application into microservices and can run each of them on different containers.</li><li>Tools like Docker, allows us to move applications freely to, from, and between Linux-based cloud environments. Using containerization, you get much closer to achieve 100% utilization of cloud instance, by helping our cloud environment efficiency to deploy multiple containerized applications on to a single cloud instance.</li></ul><h3>CONTAINER PLATFORM PROVIDERS</h3><p>There are many vendors which offer container platforms and container management tools. Below are some of the majorly used tools:</p><ul><li>Docker</li><li>CoreOS’rkt (Rocket)</li><li>Portainer</li><li>AWS ECR</li><li>Marathon</li><li>Hashicorp Nomad</li><li>Open Stack Magnum</li></ul><h3>What is docker?</h3><p>Docker is a containerization platform used to develop, ship and run containers. Docker doesn’t use a Hypervisor, and you can run Docker on your desktop if you are developing and testing applications.</p><h3>Architecture of Docker</h3><p>The Docker platform consists of following components that we use to run our containerized applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*RVQJyXJ6Y1uv-Mrh5BSIWQ.jpeg" /></figure><h4>Docker Engine</h4><p>Docker Engine is the heart of Docker ecosystem which gets installed on the host machine when you run a Docker installation. It contains various components configured in a client-server implementation where client and server run simultaneously on the same host. It contains server, REST API and CLI (Command Line Interface). When we run a Docker command, the Docker CLI takes the command using the REST API to Docker daemon and tell the Docker to execute the action.</p><h4>Docker Server</h4><p>The Docker server is a daemon called dockerd. It controls the access to host machine and manages the state of your containers and images. It responds to the requests from the client via REST API and can interact with other daemons.</p><h4>Docker CLI</h4><p>Docker CLI is a command line interface that acts as a Docker client. It is the simplest component of Docker ecosystem. Its job is to communicate with Docker daemon using the REST API.</p><h4>Docker Objects:</h4><p>There are various objects that we’ll create and configure for our deployments. These include networks, images, containers and volumes.</p><p>For further information on Docker, checkout here: <a href="https://docs.docker.com/get-started/">https://docs.docker.com/get-started/</a></p><h4>References:</h4><ol><li>MS Learn: <a href="https://docs.microsoft.com/en-us/learn/">https://docs.microsoft.com/en-us/learn/</a></li><li>Docker : <a href="https://docs.docker.com/get-started/">https://docs.docker.com/get-started/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeb2275f2062" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>