Infrastructure as Code with Terraform | Nesqual TechAll coursesInfrastructure as Code with Terraform
Run Terraform safely in a team: reviewed plans, shared state, modules, environments, tests, policy and CI.
- Access
- Pro
- Level
- Advanced
- Duration
- 44 h
- Sections
- 90
Start freeIncluded in Pro and Elite.
Course outline
The Terraform workflow in a team
- From one laptop to a teamLesson25 min
- terraform init and the dependency lock fileLesson30 min
- Plan and apply preciselyLesson30 min
- Reading plan output like a reviewerLesson30 min
- Terraform and OpenTofuLesson25 min
- How this course works: Ashgrove, the practice tree and tfminiLesson35 min
- Quiz: the Terraform workflow in a teamQuiz15 min
HCL, providers and resources
HCL syntax precisely
Lesson30 min
The terraform block and version constraintsLesson30 minConfiguring providers, aliases and credentialsLesson30 minResources, attributes and data sourcesLesson35 minMeta-arguments, provisioners and terraform_dataLesson30 minThe course linter: rules HCL001 to HCL010Lesson35 minQuiz: HCL, providers and resourcesQuiz15 minVariables, outputs and locals
- Input variables and type constraintsLesson30 min
- Assigning values: files, environment and precedenceLesson30 min
- Validating input valuesLesson30 min
- Local values: naming what mattersLesson25 min
- Outputs: the interface others readLesson30 min
- Reviewing a variable interfaceLesson35 min
- Variables, outputs and locals quizQuiz15 min
Expressions, functions and repetition
- Values, types and string templatesLesson30 min
- Operators, conditionals and nullLesson30 min
- for expressions and splatLesson35 min
- Built-in functionsLesson35 min
- count and for_eachLesson35 min
- dynamic blocks and readable expressionsLesson30 min
- Chapter quiz: expressions, functions and repetitionQuiz15 min
- Lab: predict expressions and convert count to for_eachLab40 min
The dependency graph and how a plan is made
- The dependency graphLesson30 min
- Walking the graph: parallelism, order and cyclesLesson30 min
- From three inputs to actionsLesson30 min
- Update or replace: forces replacement and create_before_destroyLesson35 min
- Deletion safety: what stops a destroyLesson30 min
- Reading plan JSON and writing a plan reviewerLesson35 min
- Quiz: the dependency graph and how a plan is madeQuiz15 min
- Lab: predict, plan and review changes to the Ashgrove baselineLab40 min
State and backends in depth
- Inside a state fileLesson35 min
- Backends: where state livesLesson30 min
- Locking and the stale-write guardLesson30 min
- Moving and protecting stateLesson30 min
- Drawing state boundariesLesson30 min
- Inspecting state safelyLesson35 min
- State and backends quizQuiz15 min
Drift, import, moved blocks and state surgery
- Drift and refresh-only plansLesson30 min
- Importing existing objectsLesson30 min
- Refactoring with moved blocksLesson30 min
- Letting go with removed blocksLesson25 min
- State surgery and when it is still rightLesson35 min
- Worked incident: the rename that nearly dropped the orders databaseLesson30 min
- Quiz: drift, import, moved blocks and state surgeryQuiz15 min
- Lab: bring the dev root back in line with realityLab40 min
Modules and composition
- Child modules: when code deserves oneLesson30 min
- Module sources and how init fetches themLesson25 min
- Designing a module interfaceLesson30 min
- Composing modules in a flat rootLesson30 min
- Ashgrove's modules across three cloudsLesson25 min
- Versioning, publishing and upgrading modulesLesson30 min
- Quiz: modules and compositionQuiz15 min
- Lab: build and compose Ashgrove's first modulesLab40 min
Environments, workspaces and large refactors
- Choosing an environment strategyLesson30 min
- CLI workspaces and their limitsLesson30 min
- Isolating environments: state, accounts and credentialsLesson30 min
- Promotion: moving one change through dev, staging and prodLesson30 min
- Refactoring across environments without destroying anythingLesson35 min
- A refactor plan: splitting one root into network and app stacksLesson35 min
- Environments, workspaces and refactoring quizQuiz15 min
Testing and validation
- A testing ladder for infrastructure codeLesson30 min
- Static checks: fmt, validate and lintersLesson30 min
- Contracts in the code: validation, preconditions, postconditions and checksLesson35 min
- Writing tests with terraform testLesson35 min
- Mock providers and overridesLesson30 min
- Plan-based tests in PythonLesson35 min
- Testing and validation quizQuiz15 min
- Lab: contracts, tests and plan checks for site-bucketLab40 min
Secrets, policy as code and security scanning
- Where secrets leakLesson30 min
- Keeping secrets out of stateLesson35 min
- Policy as code on plan JSONLesson35 min
- Reading and triaging scanner outputLesson30 min
- Least privilege for Terraform itselfLesson30 min
- One decision from lint, policy and scannerLesson30 min
- Quiz: secrets, policy and scanningQuiz15 min
- Lab: find the secrets, enforce the policy, fix the codeLab40 min
Running Terraform in CI, capstone and next steps
- Terraform inside a pipelineLesson35 min
- Credentials, concurrency and drift detectionLesson35 min
- Run platforms and the questions to askLesson30 min
- The capstone method: review and repairLesson30 min
- Where to go nextLesson25 min
- Quiz: Terraform in CI and the capstone methodQuiz15 min
- Capstone lab: review and repair Ashgrove's prodLab40 min