Infrastructure As Code?

Process of automating the provisioning and managing infrastructure through a desired and consistent state(declarative approach).

For any activities in SDLC to take place (build, test, deploy) there should be an environment, this environment is nothing but the infrastructure required for developers, the QA team, the stage team, and the production team to work on.

When we say provisioning infrastructure for various environments, it includes different entities such as machines, storage, network, users, policies, etc.

This infrastructure might be creating a new one or managing an existing one in either on-premise or any cloud providers like AWS, Azure, or GCP. Manual provisioning of different environments has some problems.

  1. Time-consuming

    if we choose any cloud services, clicking buttons in a console will take time for provisioning infrastructure.

  2. Prone to errors

  3. Difficulty in scaling

  4. Chances of over-provisioning resources, which might lead to overpricing.

so, as DevOps best practices suggest the solution to this problem is to automate the process of provisioning and managing the infrastructure of different environments in a desired & consistent state. This concept of automation of infrastructure through code is known as infrastructure as code. We only tell our desired configuration, and how to achieve it will be taken care of by the tool. The desired configuration is nothing but the file inside which we have defined the resources required for infrastructure.

Since we are developing code for infrastructure provisioning, the advantage is it is now,

  • Versionable

  • Repeatable

  • Testable