Infrastructure as Code (IaC) is the process of managing and provisioning data centers through machine-readable definition files, rather than manual point-and-click. It means writing code to define your infrastructure, in the same manner you would write code to define your application software. Expressing your infrastructure as code has many distinct advantages over manual provisioning, such as being able to check code into version control systems, perform regular audit checks, and deploy faster and more reliably.
terraform creates the infrastructure, including the machine, networking, security and monitoring the machine
terraform init
terraform plan - checks the steps inside the .tf file and lists success or errors
terraform apply - will implement the .tf file we have created - deploy the infrastructure
The idea behind infrastructure as code is that you WRITE and EXECUTE code to define, deploy, update and destroy your infrastructure. Essentially you are treating all aspects of operations as software even thoughs aspects that represent hardware(such as setting up physical servers) When implementing DevOps it should be possible to manage almost everyhting in code including: servers, databases, networks, log files, application configuration, documentation, automated tests, deployment processes...
- Ad hoc scripts
- Configuration management tools
- Server templating tools
- Orchestration tools
- Provisioning tools
- Orchestration Management tools are essential when dealing with VMs within a cloud capacity
Terraform is high-level language and is an open-source tool that is leveraged by DevOps engineers to deploy infrastructure from the comfort of their laptop.