# KodeKloud: Courses HashiCorp Certified: Terraform Associate 004 ## HashiCorp Certified: Terraform Associate 004 ### Course Introduction - [Course: HashiCorp Certified: Terraform Associate 004](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/index.md): Exam-focused, hands-on course teaching Terraform as Infrastructure as Code to prepare learners for the HashiCorp Certified Terraform Associate 004 exam and real-world multi-cloud workflows - [Course Introduction](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Course-Introduction/Course-Introduction/page.md): Exam-focused, hands-on course teaching Terraform as Infrastructure as Code to prepare learners for the HashiCorp Certified Terraform Associate 004 exam and real-world multi-cloud workflows - [About the Terraform Associate Exam](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Course-Introduction/About-the-Terraform-Associate-Exam/page.md): Guide to the HashiCorp Terraform Associate exam covering format, eligibility, logistics, question types, study tips, and recertification to prepare candidates for certification success. - [Exam Objectives what youre tested on](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Course-Introduction/Exam-Objectives-what-youre-tested-on/page.md): Outline of HashiCorp Certified Terraform Associate 0.0.4 exam objectives, study topics and practical commands highlighting configuration, state management, workflows, modules, and HCP features - [Whats New in the Terraform Associate 004 Exam](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Course-Introduction/Whats-New-in-the-Terraform-Associate-004-Exam/page.md): Summary of changes in the Terraform Associate 004 exam, highlighting four new focus areas and study guidance for upgrading from 003 or preparing anew ### Preparing Your Environment - [Section Introduction Preparing Your Environment](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Section-Introduction-Preparing-Your-Environment/page.md): Guide to preparing a workstation for Terraform labs by installing Terraform and a code editor and configuring cloud provider credentials for AWS Azure and GitHub - [Install Terraform on MacOS and Linux](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Install-Terraform-on-MacOS-and-Linux/page.md): Guide to installing Terraform on macOS and Linux using Homebrew, apt or yum/dnf repositories, or manual binary downloads, with verification and troubleshooting steps. - [Install Terraform on Microsoft Windows](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Install-Terraform-on-Microsoft-Windows/page.md): Guide to installing Terraform on Windows, covering manual binary install, adding to PATH, and automated installs via winget or Chocolatey, plus verification and next steps. - [Installing Microsoft Visual Studio Code IDE](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Installing-Microsoft-Visual-Studio-Code-IDE/page.md): Guide to downloading, installing, and configuring Visual Studio Code for editing, testing, and running Terraform and other code with extensions and integrated terminal. - [Setting Up AWS Credentials for Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Setting-Up-AWS-Credentials-for-Terraform/page.md): Guide to creating an AWS IAM user, generating access keys, and configuring credentials so Terraform can authenticate and manage AWS resources. - [Setting Up Azure Credentials for Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Setting-Up-Azure-Credentials-for-Terraform/page.md): Guide to authenticating Terraform with Azure using az login, setting subscription context, and using environment variables or service principals for noninteractive automation - [Setting Up GitHub Credentials for Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Preparing-Your-Environment/Setting-Up-GitHub-Credentials-for-Terraform/page.md): Guide to create and configure a GitHub fine-grained personal access token and securely supply it to Terraform for repository management, permissions, and token rotation ### Terraform Foundations - [Section Introduction Terraform Foundations](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Section-Introduction-Terraform-Foundations/page.md): Overview of Terraform fundamentals, workflow, core concepts, state management, collaboration, and guidance for using Terraform versus other infrastructure approaches - [Introduction to Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Introduction-to-Terraform/page.md): Overview of HashiCorp Terraform, explaining declarative IaC, key benefits, workflow, file types, commands, modular reuse, provider support, and collaboration practices for reliable infrastructure management - [Learn the Basics of HashiCorp Configuration Language HCL](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Learn-the-Basics-of-HashiCorp-Configuration-Language-HCL/page.md): A concise guide explaining HashiCorp Configuration Language HCL for writing readable, declarative Terraform configurations, including structure, examples, style conventions, and best practices. - [Lets Look at Resource Referencing with Demo](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Lets-Look-at-Resource-Referencing-with-Demo/page.md): Explains Terraform resource referencing, dependency graphs, data sources, HCL examples, and best practices for naming, formatting, and organizing .tf files - [Learn about Best Practices for HCL](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Learn-about-Best-Practices-for-HCL/page.md): Practical best practices for writing maintainable, secure Terraform HCL including file naming, formatting, repository organization, documentation, avoiding hard-coded secrets, and recommended tooling. - [Core Components and Benefits of Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Core-Components-and-Benefits-of-Terraform/page.md): Explains Terraform core components—Core, Providers, Resources, State, Modules—and how they enable declarative, versioned, reusable infrastructure provisioning and management - [Which Terraform Version Should You Use](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Which-Terraform-Version-Should-You-Use/page.md): Guide comparing Terraform Community, HCP Terraform, and Terraform Enterprise to help teams choose based on scale, collaboration, governance, and deployment needs. - [Comparing Terraform to Other Tools](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Comparing-Terraform-to-Other-Tools/page.md): Comparison of Terraform with cloud-native IaC and configuration management tools, explaining use cases, differences, and when to choose Terraform, Pulumi, CloudFormation, Bicep, or Ansible-like tools. - [Declarative vs Imperative Why Terraform Works the Way It Does](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Foundations/Declarative-vs-Imperative-Why-Terraform-Works-the-Way-It-Does/page.md): Explains Terraform's declarative model versus imperative approaches, covering plans, dependency graph, idempotency, state management, drift detection, and practical best practices ### The Core Terraform Workflow - [Section Introduction Terraform Workflow](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Section-Introduction-Terraform-Workflow/page.md): Explains the standard Terraform workflow and best practices for safely planning, applying, managing, and destroying infrastructure as code. - [Intro to the Terraform Workflow](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Intro-to-the-Terraform-Workflow/page.md): Overview of Terraform's workflow and commands, explaining writing HCL, initialization, planning, applying changes, and best practices for infrastructure as code. - [Terraform Init](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Terraform-Init/page.md): Guide to terraform init explaining initialization, provider and module downloads, backend configuration, .terraform directory and .terraform.lock.hcl file, and when to run it. - [Terraform Plan](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Terraform-Plan/page.md): Explains Terraform plan command, how it previews resource changes, interprets symbols, refreshes state, and how to save and apply plans for safe review and execution - [Understanding the Resource Graph](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Understanding-the-Resource-Graph/page.md): Explains how Terraform builds and uses the resource dependency graph, implicit versus explicit dependencies, execution parallelism, and when to use depends_on - [Terraform Apply](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Terraform-Apply/page.md): Explains how terraform apply executes planned infrastructure changes, its behaviors, invocation modes, and best practices for safe automated and interactive deployments. - [Terraform Destroy](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Terraform-Destroy/page.md): Guide explaining Terraform destroy command, how it deletes managed infrastructure, state behavior, targeted vs full destroy, dependency ordering, risks, and best practices for safe resource removal. - [Terraform Validate](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/The-Core-Terraform-Workflow/Terraform-Validate/page.md): Explains terraform validate, an offline command that checks HCL syntax, provider schema constraints, and references locally before planning or applying, but does not contact cloud providers. ### Terraform CLI - [Section Introduction Terraform CLI](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-CLI/Section-Introduction-Terraform-CLI/page.md): Introduction to the Terraform CLI, its core commands and workflow for provisioning, planning, applying, formatting, validating, and managing infrastructure as code across providers and platforms. - [Introduction to the Terraform CLI](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-CLI/Introduction-to-the-Terraform-CLI/page.md): Overview of the Terraform CLI, core commands and workflow for defining, planning, applying, and managing infrastructure as code with environment variable best practices - [Demo Terraform CLI](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-CLI/Demo-Terraform-CLI/page.md): Tutorial demonstrating Terraform CLI workflows using the random provider to create, plan, apply, inspect state, update, and destroy a random_pet resource - [Making the Most of the Terraform CLI](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-CLI/Making-the-Most-of-the-Terraform-CLI/page.md): Tips for using Terraform CLI features like shell autocomplete, contextual help, and terraform fmt to boost productivity, reduce errors, and enforce consistent configuration formatting - [Demo Making the Most of the Terraform CLI](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-CLI/Demo-Making-the-Most-of-the-Terraform-CLI/page.md): Practical guide to using the Terraform CLI including built-in help, command flags, variable and environment variable usage, and securely providing provider credentials for noninteractive workflows. ### Terraform File Structure and Organization - [Terraform File Structure and Organization](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-File-Structure-and-Organization/Terraform-File-Structure-and-Organization/page.md): Guidance on organizing Terraform configurations, file conventions, environment layouts, state handling, and best practices for modular, secure, and maintainable infrastructure code ### Terraform Configuration - Fundamentals - [HCL Basics Understanding Block Structure](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/HCL-Basics-Understanding-Block-Structure/page.md): Describes Terraform HCL block structure and common blocks with examples and best practices for writing clear, modular, and reusable infrastructure as code - [Connecting to Cloud Platforms with Provider Blocks](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Connecting-to-Cloud-Platforms-with-Provider-Blocks/page.md): Explains Terraform provider blocks, configuring platform authentication and connection details, securing credentials, and pinning provider versions for reproducible, safe management of cloud and service resources. - [Using Multiple Providers in Your Configuration](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Using-Multiple-Providers-in-Your-Configuration/page.md): Configuring and using multiple Terraform provider blocks and aliases to manage resources across different accounts, regions, and roles from a single configuration - [Creating Infrastructure with Resource Blocks](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Creating-Infrastructure-with-Resource-Blocks/page.md): Guide to Terraform resource blocks, covering structure, arguments, naming, references, and examples for declaring and managing infrastructure across providers. - [Reading Existing Resources with Data Sources](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Reading-Existing-Resources-with-Data-Sources/page.md): Explains Terraform data sources and how to read existing infrastructure attributes to reference resources dynamically and avoid hard-coded identifiers - [Parameterizing Configurations with Input Variables](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Parameterizing-Configurations-with-Input-Variables/page.md): Explains Terraform input variables and variable blocks to parameterize configurations, avoid hard coding, supply environment specific values, types, precedence, and best practices for reusable infrastructure - [Defining Variable Types](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Defining-Variable-Types/page.md): Explains Terraform variable types, including primitives and collections, their uses, examples, referencing, and best practices for validation and configuration. - [Assigning Variable Values and Understanding Precedence](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Assigning-Variable-Values-and-Understanding-Precedence/page.md): Explains Terraform variable assignment methods and their precedence, covering defaults, environment variables, .tfvars files, and command line flags with best practices for security and workflows - [Exposing Configuration Data with Output Values](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Exposing-Configuration-Data-with-Output-Values/page.md): Explains Terraform output blocks, how to define and use outputs, exposing resource attributes, passing data between modules, handling sensitive values, and best practices for automation. - [Controlling Terraform Behavior and Settings](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Configuration-Fundamentals/Controlling-Terraform-Behavior-and-Settings/page.md): Explains Terraform block for configuring required versions, provider sources and backend state, with version constraint patterns, scenarios, and best practices for team workflows. ### Understading and Managing Terraform State - [Section Intro Terraform State](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Section-Intro-Terraform-State/page.md): Introduction to Terraform state file explaining its purpose, contents, importance for planning and applying infrastructure changes, and basic commands that create and use state - [Introduction to Terraform State](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Introduction-to-Terraform-State/page.md): Explains Terraform state, its contents, importance for resource tracking and collaboration, best practices for remote backends, safe state operations, and tooling for inspecting and managing state - [Where Can I Store My Terraform State](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Where-Can-I-Store-My-Terraform-State/page.md): Explains Terraform state storage options, recommending remote backends with locking like S3 DynamoDB, Azure Blob, GCS or Terraform Cloud for team collaboration and safe state management - [Remote State Configuration](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Remote-State-Configuration/page.md): Explains how to configure Terraform remote state backends, backend options, locking, S3 and Azure examples, and best practices for collaboration and secure state management. - [Demo Remote State Configuration](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Demo-Remote-State-Configuration/page.md): Configures Terraform to store state remotely in Amazon S3 with optional DynamoDB locking, encryption, versioning, and best practices for secure team workflows. - [Demo Migrate Your State to a Remote State Configuration](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Demo-Migrate-Your-State-to-a-Remote-State-Configuration/page.md): Guide to migrating Terraform local state to and from an S3 remote backend with initialization, verification, and safety considerations. - [Inspecting Terraform State](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Inspecting-Terraform-State/page.md): Guide to inspecting Terraform state with terraform show, terraform state list, and terraform state show, plus legacy commands and configuration driven alternatives - [Demo Inspecting Terraform State using the CLI](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Demo-Inspecting-Terraform-State-using-the-CLI/page.md): Guide to using the Terraform CLI to list state resources and view full or individual resource details with terraform show and terraform state show - [Understanding State Drift Visual Walkthrough Lightboard](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Understanding-State-Drift-Visual-Walkthrough-Lightboard/page.md): Explains Terraform state drift, how to detect it with terraform plan, options to revert or adopt changes, relevant commands, and best practices for preventing and reconciling drift - [What Happens if You Lose State Visual Walkthrough Lightboard](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/What-Happens-if-You-Lose-State-Visual-Walkthrough-Lightboard/page.md): How to recover when Terraform loses its state file including restoring backups, importing existing resources, and using terraform state commands - [Detecting State Drift with Refresh Only Mode](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Detecting-State-Drift-with-Refresh-Only-Mode/page.md): Guides choosing to revert infrastructure with terraform apply or accept changes using refresh-only to update Terraform state, then update configuration and follow best practices. - [Demo Detecting State Drift with Refresh Only Mode](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Demo-Detecting-State-Drift-with-Refresh-Only-Mode/page.md): Guide to detecting and managing Terraform state drift using refresh-only applies, demonstrated with an AWS VPC and EC2 instance showing how to revert or accept external changes. - [Managing Multiple Environments with Workspaces](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Understading-and-Managing-Terraform-State/Managing-Multiple-Environments-with-Workspaces/page.md): Explains Terraform workspaces for managing multiple environment states from one configuration, showing commands, storage behavior, differences with Terraform Cloud workspaces, and best practices. ### Marking Code Reusable - [Using Built In Functions to Standardize Code](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Marking-Code-Reusable/Using-Built-In-Functions-to-Standardize-Code/page.md): How Terraform built-in functions standardize infrastructure code by simplifying string, numeric, CIDR, and type conversion tasks to reduce repetition, enforce conventions, and prevent errors. - [Enhancing Code with Dynamic Values](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Marking-Code-Reusable/Enhancing-Code-with-Dynamic-Values/page.md): Using Terraform variables, data sources, locals, and interpolation to replace hard-coded values and build reusable, environment-aware names, tags, and configurations - [Using Locals to Avoid Code Duplication](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Marking-Code-Reusable/Using-Locals-to-Avoid-Code-Duplication/page.md): Using Terraform locals to centralize repeated values, reduce code duplication, and simplify naming, tagging, and complex expressions for easier maintenance. - [Using the count Meta Argument](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Marking-Code-Reusable/Using-the-count-Meta-Argument/page.md): Describes Terraform's count meta-argument for creating multiple indexed resources, index behavior, when to use or avoid it, comparison with for_each, and practical tips. - [Using the for each Meta Argument](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Marking-Code-Reusable/Using-the-for-each-Meta-Argument/page.md): Explains Terraform's for_each meta-argument, creating uniquely keyed resource instances from maps or sets and contrasts with count, with examples and best practices. ### Refactoring Terraform State - [Refactoring Terraform State](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Refactoring-Terraform-State/Refactoring-Terraform-State/page.md): How to refactor Terraform state using moved, removed, and import blocks to reorganize resource tracking safely, preview changes, and maintain auditability with best practices. - [Moving Resources with the moved Block](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Refactoring-Terraform-State/Moving-Resources-with-the-moved-Block/page.md): Explains Terraform's moved block for safely renaming or relocating resources by updating state without destroying infrastructure. - [Removing Resources with the removed Block](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Refactoring-Terraform-State/Removing-Resources-with-the-removed-Block/page.md): Explains Terraform's removed block to remove resources from state without destroying infrastructure, including examples, step by step workflow, warnings, and best practices ### Terraform Modules - [Introduction to Modules](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Introduction-to-Modules/page.md): Overview of Terraform modules, explaining their purpose, structure, reuse, file layout, benefits, and best practices for versioning, publishing, and testing reusable infrastructure components. - [Understanding Parent and Child Modules](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Understanding-Parent-and-Child-Modules/page.md): Explains Terraform parent and child modules, how to source and call reusable child modules, pass inputs, retrieve outputs, and follow best practices for modular infrastructure - [Module Versioning and Version Constraints](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Module-Versioning-and-Version-Constraints/page.md): Explains Terraform module versioning, pinning and semantic version constraints, and best practices for testing and upgrading modules to ensure stable, repeatable deployments. - [Calling Modules with the Module Block](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Calling-Modules-with-the-Module-Block/page.md): Introduction to Terraform module blocks explaining how to call and reuse modules to encapsulate infrastructure, pass inputs and consume outputs for consistent, maintainable, and reusable configurations - [Understanding Variable Scope in Modules](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Understanding-Variable-Scope-in-Modules/page.md): Explains Terraform module variable scope, passing inputs to child modules, returning outputs to root, with examples, common mistakes and best practices - [Demo Using Modules from the Terraform Registry](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Demo-Using-Modules-from-the-Terraform-Registry/page.md): Hands-on guide to using Terraform Registry modules to provision an AWS VPC and security group and to pass outputs between modules - [Demo Writing and Using Your Own Modules](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Modules/Demo-Writing-and-Using-Your-Own-Modules/page.md): Guide to building and using local Terraform modules to provision AWS VPC, subnet, and EC2 resources, illustrating inputs, outputs, reuse, and module organization ### Managing Resource Behavior and Dependencies - [Controlling Resource Order with Explicit Dependencies](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Managing-Resource-Behavior-and-Dependencies/Controlling-Resource-Order-with-Explicit-Dependencies/page.md): Explains using Terraform depends_on to enforce explicit resource creation order, prevent race conditions, and when to prefer implicit dependencies - [Managing Resource Behavior](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Managing-Resource-Behavior-and-Dependencies/Managing-Resource-Behavior/page.md): Guide to Terraform lifecycle meta-argument usage for controlling resource creation, updates, and deletion with options like prevent_destroy and ignore_changes - [Demo Manage Resource Behavior with lifecycle](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Managing-Resource-Behavior-and-Dependencies/Demo-Manage-Resource-Behavior-with-lifecycle/page.md): Demonstrates Terraform's lifecycle ignore_changes to allow out-of-band updates (like manual S3 tag edits) so Terraform won't revert specified attribute changes. - [Validating Your Configuration](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Managing-Resource-Behavior-and-Dependencies/Validating-Your-Configuration/page.md): Explains Terraform's four validation mechanisms, when they run, and examples to enforce input rules, preconditions, postconditions, and non-blocking checks to prevent deployment errors. ### Securing Terraform Configurations - [Why Secrets in Terraform Are Risky](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Why-Secrets-in-Terraform-Are-Risky/page.md): Risks of secrets in Terraform workflows and practical mitigations to protect state, logs, VCS, and plan artifacts using encryption, access controls, sensitive flags, and external secrets managers - [Protecting Secrets in Your Configuration](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Protecting-Secrets-in-Your-Configuration/page.md): Practical techniques for protecting secrets in Terraform configurations using sensitive variables, environment variables, external secret stores, and securing state to prevent accidental leakage. - [Hiding Secrets with Sensitive Variables and Outputs](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Hiding-Secrets-with-Sensitive-Variables-and-Outputs/page.md): Using Terraform's sensitive = true to redact secrets from CLI output and CI logs, while explaining limitations and recommending encrypted state backends and secret management - [Keeping Secrets Out of Version Control with Environment Variables](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Keeping-Secrets-Out-of-Version-Control-with-Environment-Variables/page.md): Explains using environment variables and CI/CD secret stores to keep Terraform secrets out of version control and secure state - [Reading Secrets from External Sources](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Reading-Secrets-from-External-Sources/page.md): Using external secrets managers with Terraform to retrieve secrets at runtime, avoid storing credentials in code, and protect secrets through secure backends, sensitive variables, and least-privilege access - [Securing State Files](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Securing-State-Files/page.md): How to protect Terraform state files by using encrypted remote backends, state locking, IAM controls, and audit logging to prevent exposing secrets - [Keeping Secrets Out of State with Ephemeral Values and Write only Arguments](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Keeping-Secrets-Out-of-State-with-Ephemeral-Values-and-Write-only-Arguments/page.md): Explains using ephemeral values and write-only arguments to prevent secrets from being written into Terraform state, plus usage patterns, limitations, and recommended best practices. - [Working with HashiCorp Vault Patterns and Approaches](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Securing-Terraform-Configurations/Working-with-HashiCorp-Vault-Patterns-and-Approaches/page.md): Explains using HashiCorp Vault to generate short‑lived credentials for Terraform, enabling ephemeral access, centralized secrets management, rotation, and improved auditability in automated workflows. ### Terraform Troubleshooting - [Debugging Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Troubleshooting/Debugging-Terraform/page.md): Explains how to enable and use Terraform logging environment variables, log levels, core versus provider logging, capturing logs to files, and tips for troubleshooting and filing bug reports. - [Demo Debugging Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/Terraform-Troubleshooting/Demo-Debugging-Terraform/page.md): Guide on enabling and using Terraform logging with TF_LOG and TF_LOG_PATH to capture and redact detailed diagnostic logs across platforms for debugging provider and core issues ### HCP Terraform - [HCP Terraform Overview longer video](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/HCP-Terraform-Overview-longer-video/page.md): Overview and practical guide to HCP Terraform explaining managed remote state, remote execution, team collaboration, policy enforcement, workflows, tiers, and setup for scaling Terraform workflows - [Demo Setting Up Your HCP Terraform Account](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Demo-Setting-Up-Your-HCP-Terraform-Account/page.md): Step-by-step guide to create and configure a Terraform Cloud account, organization, security settings, VCS integration, and workspaces for automated Terraform runs. - [Getting Connected and Authenticated with HCP Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Getting-Connected-and-Authenticated-with-HCP-Terraform/page.md): Guide to configure Terraform cloud block and authenticate the local CLI with HCP Terraform using terraform login or TF_TOKEN_app_terraform_io for interactive and CI workflows - [Understanding HCP Terraform Workspaces](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Understanding-HCP-Terraform-Workspaces/page.md): Explains differences between Terraform CLI workspaces and HCP Terraform workspaces, detailing workspace contents, workflows, management, isolation, and certification tips - [Demo Creating a Workspace](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Demo-Creating-a-Workspace/page.md): Guide to creating and configuring an HCP Terraform workspace, connecting local CLI, managing variables, execution mode, Terraform version, VCS, policies, runs, and destroying resources. - [HCP Terraform Execution Modes](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/HCP-Terraform-Execution-Modes/page.md): Explains HCP Terraform execution modes remote, local, and agent, detailing where runs execute, state behavior, feature trade offs, and recommended use cases for teams. - [Demo Migrating State to HCP Terraform](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Demo-Migrating-State-to-HCP-Terraform/page.md): Guide to migrate a local Terraform configuration and state into an HCP Terraform workspace, configure remote runs with AWS credentials, and execute remote plans and applies. - [Demo Automating Runs with VCS Driven Workflow](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Demo-Automating-Runs-with-VCS-Driven-Workflow/page.md): Guide showing how to convert a Terraform Cloud workspace to VCS-driven workflow so commits trigger plans, configure triggers, review speculative plans, and confirm applies. - [Organizing Your Work with Projects](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Organizing-Your-Work-with-Projects/page.md): Using projects in HCP Terraform to group workspaces, apply shared settings and permissions, prevent workspace sprawl, and simplify administration - [Demo Working with Projects](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Demo-Working-with-Projects/page.md): Guide to creating and managing Terraform Cloud projects, configuring defaults, auto-destroy, moving workspaces, and using the Terraform CLI with cloud-targeted workspaces - [Sharing Variables with Variable Sets](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Sharing-Variables-with-Variable-Sets/page.md): How to use centralized variable sets in HCP Terraform to share, scope, and manage variables across workspaces with precedence and best practices - [Demo Creating Variable Sets](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Demo-Creating-Variable-Sets/page.md): Guide on creating, scoping, and managing Terraform Cloud variable sets for organization, project, and workspace levels with precedence rules and best practices for sensitive values. - [HCP Terraform Teams Permissions](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/HCP-Terraform-Teams-Permissions/page.md): Explains teams, roles, and permission scopes in HCP Terraform, covering organization, project, and workspace access, Owners team, team visibility, and team tokens. - [Private Registry](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Private-Registry/page.md): Explains the HCP Terraform Private Registry, how to publish and version private modules from VCS, and how organizations share, consume, and enforce standardized infrastructure modules. - [Policy Enforcement using Sentinel OPA Part 1](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Policy-Enforcement-using-Sentinel-OPA-Part-1/page.md): Explains using Sentinel and OPA in HCP Terraform to enforce policy-as-code by evaluating Terraform plans and blocking noncompliant or risky infrastructure changes before apply. - [Policy Enforcement using Sentinel OPA Part 2](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Policy-Enforcement-using-Sentinel-OPA-Part-2/page.md): Explains Sentinel and OPA enforcement levels, organizing policies into policy sets in HCP Terraform, capabilities and limitations, and exam-focused takeaways - [Additional HCP Terraform Features](https://notes.kodekloud.com/docs/HashiCorp-Certified-Terraform-Associate-004/HCP-Terraform/Additional-HCP-Terraform-Features/page.md): Overview of HCP Terraform features for detecting drift, validating resources, automating inter-workspace runs, and tracking workspace change requests to manage infrastructure at scale.