Skip to main content

Infrastructure-as-Code (IaC)

Definitions

Tools

NameTypeTechnologyArchiCloud?Components
AnsibleConfiguration ManagementYamlAgentlessAllModules, Playbooks
BicepBicepAzure-
Azure Resource ManagerJsonAzure-
Chef-
Pulumi-
PuppetConfiguration ManagementRubymaster/slaveAll-
TerraformOrchestrationHCL, GoAllProviders, Modules

Technologies

Key ElementTerraformAnsiblePuppet
PurposeInfrastructure provisioningConfiguration management and task automationConfiguration management and server automation
ArchitectureClient-only, interacts directly with provider APIsAgentless, uses SSH (or WinRM for Windows) for push-based executionClient-server model with Puppet Server and agents (pull-based)
LanguageHCL (HashiCorp Configuration Language) or JSONYAML (playbooks)Puppet DSL (Ruby-based)
IdempotencyYes, reconciles desired state with actual state via state fileYes, tasks only apply changes when neededYes, ensures consistent state via catalog application
State ManagementUses terraform.tfstate to track infrastructure state (critical, stored locally or remotely)Stateless; relies on system state and idempotent tasksState managed via PuppetDB and catalogs, compiled by Puppet Server
Key ComponentsResources, providers, modules, state file, backendPlaybooks, inventory, roles, modules, tasksManifests, modules, resources, Facter, Hiera, PuppetDB
Execution ModelDeclarative; terraform plan previews, terraform apply executesPush-based; ansible-playbook pushes tasks to hostsPull-based; agents poll Puppet Server for catalogs
Sensitive Data HandlingVariables, .tfvars, remote backends (e.g., S3), or Vault integrationAnsible Vault, external tools (e.g., HashiCorp Vault)Hiera with hiera-eyaml, external tools (e.g., Vault)
ModularityModules for reusable configurations, stored in Terraform RegistryRoles and collections (modules & plugins), stored in Ansible GalaxyModules for reusable manifests, stored in Puppet Forge
Inventory/Node ManagementNot applicable; manages infrastructure, not nodesStatic or dynamic inventory (e.g., aws_ec2 plugin)Node classification via Puppet Server or external node classifiers (ENC)
Environment ManagementWorkspaces or separate directories with .tfvars for dev/staging/prodSeparate inventories or group_vars for dev/prodEnvironments in /etc/puppetlabs/code/environments with Hiera data
Error HandlingDebug with terraform plan, logs, or terraform apply -replace for resource issues (instead of taint)Use ignore_errors, failed_when, or --verbose for debuggingDebug with puppet agent --debug, logs, or fail() function
Testing Toolsterraform validate, Terratest, Checkov, TFLintansible-lint, Molecule, --check modepuppet-lint, rspec-puppet, puppet parser validate
ScalabilityScales via remote backends (e.g., S3, Terraform Cloud) with lockingScales with strategy: free, forks, or Ansible TowerScales with Puppetserver tuning, PuppetDB, or HA Puppet Server
Security Best PracticesEncrypt state files, use IAM roles, remote backends with lockingUse Ansible Vault, secure SSH keys, restrict playbook accessUse SSL for Puppet Server, Hiera encryption, RBAC
Common IntegrationsTerraform Cloud, Infracost, AWS/GCP/Azure providersAnsible Tower/AWX, dynamic inventory plugins, VaultPuppet Enterprise, PuppetDB, r10k, Puppet Forge
Use Case ExampleProvision AWS VPC, EC2, and RDS across regionsConfigure Nginx, manage users on multiple serversManage Apache, MySQL configs, and services on Linux/Windows servers
Key differenciatorProvisioning focusAgentless simplicityClient-server robustness