What you need to Know about IAAC
IAAC defined
- provisioning infra through software for consistent and predictable deployments
- useful when running multiple environments
Core Concepts
- IAAC is defined in code, creating files like JSON or YAML or Hashicorp Config language
- IAAC is stored in source control, like Git or GitHub.
- can be worked on by multiple developers simultaneously
- IAAC can be declarative or imperative
- Idempotency and Consistency
- Pushing or Pulling configurations to environment
Declarative or Imperative
Imperative software tells the proper order of deployment, procedural, exacty
Declarative Software has a rough idea how to make environment, using a config language you can declare what type of thing (food), with a sub-type (taco), and within the config-block can list the components (ingredients).
The software already has a predefined routine how to get ingredients, and and a predefined order to deploy them.
The defaults can be changed by adding options to config block.
Terraform using Declarative software
Idempotent and Consistent
- In idempotent software, the software is aware of the state of the world and will not redeploy infrastructure that it already knows exists.
- i.e. if you haven’t changed anything about code and apply to same environment, the software will not act because the instruction already matches the environment’s infra.
- In non idempotent software, every time instruction is given, something is deployed
- Terraform attempts to be idempotent
Push or Pull
- Terraform is a push type model.
- The config in Terraform gets pushed to the env
- Pull type model is when there’s an agent running in target env and pulls its config from a central source
Benefits of IAAC
- Automated Deployment,
- faster usually better
- Repeatable
- each time you need to build out or update env
- Creates multiple consistent environment.
- Useful for ensuring Dev, QA, Staging and Production envs to match
- Reusable components
- as process is defined in code, it can be reuse in any application that needs a similar back-end, makes life a lot easier
- Follows the DRY programming principle, Don’t Repeat Yourself
- Documented Architecture
- natural result of defining in code, gives a better understanding of architecture and how it works
Overview of Terraform
- IAAC isn't scary
- Manual processes are the enemy, mistakes happen
- Automating makes sense
- If caught in a roadblock, step away from problem, helps with thinking process