Is the process where Developers and DevOps team auto-magically manages and provision tech stack for an application using a software rather than doing it manual configuration of Hardware or OS using declarative definition file.
With IaC we can build stable environment much Faster and Scale it, we can also enforce the consistency via code.
There is no single standard syntax for declarative IaC, different platform supports different and often multiple ,file formats as well such as YAML, JSON and XML.
IaC is supported by list of popular third party tools such as Terraform, Ansible, Puppet. In this post we will use Terraform and cloud provider will be AWS. Terraform is supported by all major cloud provider i,e GCP, Azure.
First we need to install Terraform , I am using Mac so I can use brew to install Terraform if you are on Windows or Linux you can download it from here
Now, you might be working for different client who uses different version of terraform for that there is a quick switchTo program which you can install and its really helpful in such cases.
brew install warrensbox/tap/tfswitch
Now let's use code and create Infrastructure but before that I need to configure the aws-cli and secure the key, you can put them in the env. variables or in Vault providers as well, first I would like to create a VPC, its very simple just couple of lines of code and we will see who easy it is.