Sobes.tech
Junior — Middle

Why is it important to have an infrastructure description in the form of code?

sobes.tech AI

Answer from AI

Infrastructure as Code (IaC) is important for several reasons:

  • Repeatability and consistency: you can create identical environments without errors related to manual configuration.
  • Automation: simplifies deployment and updating of infrastructure.
  • Versioning: changes to infrastructure can be tracked and rolled back if necessary.
  • Documentation: code serves as living documentation for the infrastructure.
  • Speed and scalability: quickly scale and modify infrastructure to meet project needs.

Example using Terraform:

resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
}

This code describes a virtual machine that can be created and modified programmatically.