<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Terraform on Niels Ophey</title><link>https://www.ophey.net/en/tags/terraform/</link><description>Recent content in Terraform on Niels Ophey</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 31 Mar 2020 17:42:14 +0200</lastBuildDate><atom:link href="https://www.ophey.net/en/tags/terraform/index.xml" rel="self" type="application/rss+xml"/><item><title>Learn Terraform - Deploy an App Service instead of a scale set</title><link>https://www.ophey.net/en/blog/learn-terraform-app-service/</link><pubDate>Tue, 31 Mar 2020 17:42:14 +0200</pubDate><guid>https://www.ophey.net/en/blog/learn-terraform-app-service/</guid><description>&lt;p>As mentioned in my post before, it is no so easy as a beginner to get everything realized in Terraform. The challenge was, deploy to a web site in Azure which is able to scale out behind a load balancer. After demonstrating the way be using virtual machine scale sets, I would like to show the way I found with &lt;a href="https://azure.microsoft.com/services/app-service/">Azure App Services&lt;/a> as the service to go to.&lt;/p>
&lt;p>If you take a look at the simple sample in the &lt;a href="https://docs.microsoft.com/azure/app-service/app-service-web-get-started-html">documentation&lt;/a>, you see that it is very easy to deploy a simple website in azure. Out of this, my idea was, it could not be so complicated in Terraform to achieve the same.&lt;/p></description></item><item><title>Learn Terraform - Define a virtual machine scale set</title><link>https://www.ophey.net/en/blog/learn-terraform-vmss/</link><pubDate>Tue, 31 Mar 2020 11:01:08 +0200</pubDate><guid>https://www.ophey.net/en/blog/learn-terraform-vmss/</guid><description>&lt;p>Now that we have one VM serving a web site, it is a common pattern to deploy not only one VM. Use multiple VMs to distribute the load. In Azure, this feature is called a virtual machine scale set (see the &lt;a href="https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/tutorial-create-and-manage-powershell">DOCs&lt;/a>).&lt;/p>
&lt;p>To build this in Terraform we need the &lt;em>azurerm_linux_virtual_machine_scale_set&lt;/em> resource type. The &lt;a href="https://www.terraform.io/docs/providers/azurerm/r/linux_virtual_machine_scale_set.html">documentation&lt;/a> shows a sample on how to use it.&lt;/p>
&lt;h2 id="please-read-first">Please read first!&lt;/h2>
&lt;blockquote>
&lt;p>But &lt;strong>CAUTION&lt;/strong> - I have done everything several times and tried a lot of possible parameters to deploy the scales set including the Apache webserver. I did not find out, why the configuration of the custom script extension does not work during the initial deployment. Only if you change the VM count after the deployment, the custom script will be deployed. You can see this issue &lt;a href="https://github.com/terraform-providers/terraform-provider-azurerm/issues/5860">here&lt;/a>.&lt;/p></description></item><item><title>Learn Terraform - How can we make the Linux VM become a Web Server</title><link>https://www.ophey.net/en/blog/learn-terraform-web-server/</link><pubDate>Fri, 27 Mar 2020 16:15:52 +0200</pubDate><guid>https://www.ophey.net/en/blog/learn-terraform-web-server/</guid><description>&lt;p>The next iteration of the VM is to configure a Web Server running on the VM and add an auto-scaling function as well as a load balancer. Due to the point, that I&amp;rsquo;m not so aware of Linux, I took a little bit different approach to have a Web Server running on the VM. Yevgeniy uses in his book the following &amp;ldquo;user_data&amp;rdquo; option to have a web site been served by our VM.&lt;/p></description></item><item><title>Learn Terraform - deploy the first VM</title><link>https://www.ophey.net/en/blog/learn-terraform-deploy-first-vm/</link><pubDate>Thu, 19 Mar 2020 15:21:07 +0200</pubDate><guid>https://www.ophey.net/en/blog/learn-terraform-deploy-first-vm/</guid><description>&lt;p>After terraform is installed on the computer you use to deploy your first cloud resources - the initial sample in chapter 2 is to deploy a VM. A Linux based VM. You can find all the samples out of the book from Yevgeniy under &lt;a href="https://github.com/brikis98/terraform-up-and-running-code">this repro in GitHub&lt;/a>.&lt;/p>
&lt;p>So how do we do this in azure?&lt;/p>
&lt;h2 id="deploy-your-first-vm-in-azure">Deploy your first VM in Azure&lt;/h2>
&lt;p>One main difference to aws is that in Azure we deploy resources always in a resource group (RG) - so the script in Terraform is not so easy as in aws.&lt;/p></description></item><item><title>Learn Terraform - get started...</title><link>https://www.ophey.net/en/blog/learn-terraform-get-started/</link><pubDate>Sun, 15 Mar 2020 16:20:59 +0200</pubDate><guid>https://www.ophey.net/en/blog/learn-terraform-get-started/</guid><description>&lt;p>After reading Chapter 1 of the &lt;a href="https://www.terraformupandrunning.com/">book&lt;/a> it was time to get my machine ready for using Terraform to script the deployments in Azure. So I search the Microsoft Docs for a short guide and found this short &lt;a href="https://docs.microsoft.com/azure/terraform/terraform-install-configure?toc=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fterraform%2Ftoc.json&amp;amp;bc=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fbread%2Ftoc.json">description&lt;/a>.&lt;/p>
&lt;h2 id="first-step---install-terraform-on-my-machine">First Step - Install Terraform on my machine&lt;/h2>
&lt;p>I decided to install Terraform in the Windows Subsystem for Linux (WSL) on my Windows10 machine. I&amp;rsquo;m on the fast-ring in the Windows10 insider program - so I&amp;rsquo;m already able to use WSL2. If you want to learn more about WSL2 visit the Microsoft page &lt;a href="https://aka.ms/wsl2">https://aka.ms/wsl2&lt;/a>. To install Terraform in my WSL2 I opened the bash and entered the following command (use &lt;em>sudo&lt;/em> of needed to have privileged rights):&lt;/p></description></item><item><title>Learn Terraform</title><link>https://www.ophey.net/en/blog/learn-terraform/</link><pubDate>Sun, 15 Mar 2020 14:36:21 +0200</pubDate><guid>https://www.ophey.net/en/blog/learn-terraform/</guid><description>&lt;h2 id="how-i-started">How I started&lt;/h2>
&lt;p>I just decided to learn more about using Terraform to deploy services in azure. In the past, I deployed most of the time my services in the Azure by using the portal, the azure-CLI or using ARM templates. During a lot of discussions around automation, I heard a lot of people talking about Terraform as their choice for scripting their deployments. Especially thanks to my colleague Arnaud Lheureux - we sit together on the Microsoft Ready in the booth around the Cloud Adoption Framework and he showed me what he already has done with Terraform to deploy a landing zone in Azure. That was the impulse to start to learn more about Terraform&amp;hellip;&lt;/p></description></item></channel></rss>