Infrastructure As Code (IAC)
In modern world technologies, provisioning infrastructure is the biggest challenge. There are lots of cloud providers who can help to provide resources such as virtual machines, networking, databases and storage devices etc., You can use any one of them and build/create your infrastructure based on your business need.
There are two ways you can obtain their resource provisioning.
- Management Console
- Through coding
Out of these two, the better way is to code the entire provisioning process. The reason for this is that you can write the code to define provision, configure, update and destroy all resources whenever you don't need them, and you can redo this process anytime without manual intervention. Whereas, in the management console, you need to do them manually every single time which is not the correct way. This is called Infrastructure As Code (IAC).
With IAC, we can define infrastructure resources using simple, human-readable high level language.
Types of IAC tools
- Configuration Management
- Ansible
- Puppet
- Saltstack
- Chef
- Server Templating
- Docker
- Vagrant
- Packer
- Provisioning Tools
- Terraform
- Cloud Formation
1.Configuration Management
- These are used to install and manage the software on existing infrastructure resources.
- It maintains the standard structure of the code (Not like we write the code for our need) and it can be reused.
- It designed to run in multiple resources at once (You can create and execute resources in multiple machine using single command).
- Version control options (You can update/upload your ansible playbook/role into version control repo [ansible galaxy]).
- They are idempotent. It means if the resources are already exist, we don't need to create them again. Those creating code can be skipped easily (For this, we don't need to write any logic, it can be handled by default) and move to next steps/process.
2.Server Templating
- It is used to create a custom images of VMs/containers. These VMs/containers are already preinstalled all required software and dependencies.
- Immutable infrastructure
- Once you deployed a VM/container, you CANNOT change their config. It remains unchanged. (This can be possible in configuration management tools such as Ansible)
- If you need to change, you can update the image and redeploy.
3.Provisioning Tools
- These tools are used to provisioning the infrastructure components (can be servers/DBs/NW devices/storages/security groups/VPCs/services) using simple code.