Using variables in Terraform

Using variables in Terraform

I hope my previous article on Terraform was helpful and you were able to create your first AWS EC2 instance using Terraform. Further in this article we are going to talk about variables. Variables are important part of Terraform. There would be elements which would change or reused. Based on different requirements some decisions need to be made. Also, you don't want to keep your credentials in plain text files. Different AMIs need to used depending upon region and requirement. Variables are always helpful to remove ambiguity in code. In last article we used…Read more …
Re-execute User Data script for windows instance in AWS

Re-execute User Data script for windows instance in AWS

User data is one of the cool feature of AWS. You can define the code which want to execute immediately after instance is created. But once it is executed the feature is immediately disabled. If you will execute the user data changes want apply. If you want to execute code using user data in later, you need to make changes to “config.xml”. You can use below script to enable user data feature. Example, from the documentation: $EC2SettingsFile="C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml" $xml = [xml](get-content $EC2SettingsFile) $xmlElement = $xml.get_DocumentElement() $xmlElementToModify = $xmlElement.Plugins foreach ($element in $xmlElementToModify.Plugin)  …Read more …

Getting started with Terraform

IT has been changes fast. We are moving from owning the resources to renting the resources in cloud. With this roles in companies are also changing rapidly. Administrators are learning to code now. It looks like in future Infrastructure is also going to be code. Write a program for new server. I started my career as an administrator, later I got interested in PowerShell scripting and now it looks like I am going to be full time developer. I am interested in a new tool recently which has captured a lot of market,…Read more …