Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Terraform and Terragrunt: Managing passwords and secrets
Highest Rated
Rating: 4.8 out of 5(21 ratings)
2,173 students

Terraform and Terragrunt: Managing passwords and secrets

How to handle secrets inside Terraform and Terragrunt setups
Created byPaweł Tokarz
Last updated 6/2026
English
English [Auto],

What you'll learn

  • How to manage your Terraform secrets
  • How to use Terragrunt to better manage secrets in Terraform
  • Different Terraform and Terragrunt approaches to secret managment
  • Manage Terraform secrets using SOPS, AWS and Vault
  • Environment variables: Students will learn how to pass secrets securely through environment variables, keeping them out of version control.
  • External secret management tools: The course covers integrating Terraform and Terragrunt with tools like HashiCorp Vault and AWS Secrets Manager, which provide
  • Encrypted files: Techniques for encrypting files using tools like SOPS or AWS KMS will be demonstrated, ensuring that secrets remain secure even when stored in

Course content

10 sections51 lectures3h 59m total length
  • Introduction1:25

    Learn to store and hide secrets in Terraform and Terragrunt, preventing plain-text exposure in GitHub and repositories, with practical modules, configurations, and links.

  • Secure your remote state backend3:31

    Terraform and Terragrunt manage state files reflecting your environment and securely store passwords and secrets in protected backends. Limit access; use backends like S3 or GCS, and automate with CI/CD.

  • Sensitive values5:22

    Learn to manage secrets in Terraform and Terragrunt with sensitive variables and the sensitive function to hide values in plans, applies, outputs, and logs, stored in the state file.

Requirements

  • Terraform, Terragrunt, AWS, Linux, GIT, Hashicorp Vault
  • Basic Understanding of Terraform: Students should have a foundational knowledge of Terraform, including core concepts like providers, resources, and modules. Familiarity with writing basic Terraform configurations is essential to grasp the more advanced concepts covered in the course
  • Experience with Cloud Providers: Since much of the course involves managing secrets in cloud environments (e.g., AWS, Azure, Google Cloud), having access to a cloud provider account and some experience with cloud infrastructure is helpful for practical exercises
  • Familiarity with Basic Security Concepts: Students should have a basic understanding of security principles, such as encryption, access control, and authentication. This will help when learning about secret management tools and securing sensitive data in Terraform configurations
  • Terraform and Terragrunt Installed on Local Machine: To follow along with hands-on examples and exercises, students need to have tools installed
  • Basic Command Line Skills: Since much of the course involves working with environment variables, encryption tools, and secret management systems through the command line, students should be comfortable using terminal commands

Description

This course is going to present you various approaches to handle passwords and secrets in Terraform and Terragrunt setups.


Hiding secrets and passwords is important because it helps prevent unauthorized access to sensitive information. In your day to day work you might be working with API keys, tokens, password, credentials to database etc.

By hiding secrets, you can ensure that only authorized users and applications have access to them, and that they are not exposed to potential attackers. This can help improve the security of your systems and reduce the risk of data breaches and other security incidents. Limiting access to secrets to dedicated teams, you can also reduce the risk of accidental exposure or misuse of sensitive information. Additionally, dedicated teams can ensure that secrets are properly rotated and managed over time, which is critical for maintaining the security of your systems and data.


My goal for this course is to provide you with the knowledge and tools necessary to effectively manage secrets in your Terraform and Terragrunt projects. I hope you will find solution that fulfill your needs.

We will evaluate the advantages and disadvantages of each of these methods, and then shift our attention to their practical implementation.


Our lessons will focus on:

  • Securing Terraform state backend

  • Hiding secrets in output

  • Environment variables

  • AWS Secret Manager (and any other Cloud Secret Manager)

  • Hashicorp Vault

  • File encryption using AWS KMS service

  • File encryption using git-crypt

  • File encryption using SOPS

Who this course is for:

  • DevOps professionals who are responsible for automating infrastructure deployments will benefit from learning how to securely manage secrets within Terraform and Terragrunt workflows. The course will equip them with the tools and techniques necessary to prevent unauthorized access to sensitive data, ensuring secure infrastructure provisioning
  • Cloud engineers working with platforms like AWS, Azure, or Google Cloud will find this course particularly useful. Since cloud environments often require API keys, credentials, and other secrets for resource provisioning, this course will help them integrate secret management solutions like AWS Secrets Manager or HashiCorp Vault into their IaC practices
  • Security-focused professionals who oversee the protection of sensitive data in infrastructure setups will gain valuable insights into how to manage secrets securely in Terraform configurations. The course covers best practices for encrypting files, securing state backends, and limiting access to sensitive information
  • CloudOps professionals need this course to securely manage secrets, automate cloud infrastructure, and ensure efficient, secure cloud operations
  • SecOps professionals need this course to securely manage sensitive data, enforce compliance, and protect infrastructure from unauthorized access
  • DevSecOps professionals need this course to securely manage secrets, automate workflows, and prevent vulnerabilities in Infrastructure as Code
  • Software engineers who are involved in writing or maintaining Terraform configurations will benefit from learning how to avoid common pitfalls like hardcoding secrets in configuration files. This course will teach them how to integrate external secret management tools and securely manage sensitive data across multiple environments
  • IT administrators responsible for managing infrastructure at scale will find this course helpful in understanding how to handle secrets across various environments securely. They will learn about environment variables, file encryption techniques, and external secret stores that can be integrated with Terraform
  • For teams managing complex multi-environment setups (e.g., development, staging, production), this course provides practical guidance on how to use Terragrunt to manage secrets across different environments efficiently while maintaining security best practices