Catalog
concept#DevOps#Platform#Infrastructure

Infrastructure as Code (IaC)

Infrastructure as Code automates the provisioning and management of IT infrastructure.

Infrastructure as Code (IaC) is an approach that allows infrastructure to be defined and provisioned through code.
Established
Medium

Classification

  • Medium
  • Technical
  • Technical
  • Advanced

Technical context

JenkinsGitHubKubernetes

Principles & goals

Versioning of infrastructure is essential.Repeatability is crucial for success.Automation minimizes human errors.
Build
Enterprise, Domain, Team

Use cases & scenarios

Compromises

  • Errors in the code can lead to downtime.
  • Improper usage can create security risks.
  • Complexity can lead to a knowledge gap.
  • Use a version control system.
  • Document changes thoroughly.
  • Conduct regular reviews.

I/O & resources

  • Infrastructure scripts
  • Cloud credentials
  • Version control system
  • Provisioned infrastructure resources
  • Provisioning reports
  • Change logs

Description

Infrastructure as Code (IaC) is an approach that allows infrastructure to be defined and provisioned through code. This improves efficiency, reduces the likelihood of errors, and facilitates tracking changes.

  • Reduced provisioning time for infrastructure.
  • Increased consistency in infrastructure.
  • Better traceability of changes.

  • Requires expertise in script creation.
  • Can be complex in large environments.
  • Maintenance of the scripts is required.

  • Provisioning Time

    The time taken to provision infrastructure.

  • Error Rate

    Number of errors during provisioning.

  • Cost per Provisioning

    The costs associated with provisioning infrastructure.

AWS CloudFormation Example

An example of using AWS CloudFormation for automated provisioning of EC2 instances.

Terraform Example

An example of how Terraform can be used to manage infrastructure across different clouds.

Ansible Example

An example of using Ansible for configuring server resources.

1

Define infrastructure in code.

2

Automate provisioning with IaC tools.

3

Test and validate the infrastructure.

⚠️ Technical debt & bottlenecks

  • Outdated scripts without maintenance.
  • Lack of modularity in scripts.
  • Insufficient commenting of the code.
Maintenance ComplexityTraining CostsLack of Standards
  • Incorrect configuration of cloud resources.
  • Insufficient testing of scripts before provisioning.
  • Ignoring security protocols.
  • Creating too much complexity.
  • Frequent changes without tests.
  • Lack of understanding of the code.
Knowledge of scripting languagesExperience working with cloud servicesFamiliarity with CI/CD tools
Automation is crucial.Requires scalable solutions.Must consider security.
  • Compliance standards must be adhered to.
  • Technological frameworks must be considered.
  • Resources must be secured.