Mastering Terraform Moved Block

Mastering Terraform Moved Block

In today’s blog post, we will discuss terraform moved block, used to rename or move terraform resources. Terraform is the most widely used Infrastructure as Code (IaC) tool in the cloud and DevOps field. But as your infrastructure as code (IaC) grows, refactoring your configurations becomes a nightmare. Renaming a resource, reorganizing modules, or switching … Read more

Mastering Terraform Ephemeral Resources

In today’s blog post, we will learn terraform ephemeral resources. Ephemeral resources are used to safely store and handle sensitive data (passwords, api tokens, secrets, hash) in terraform. Terraform is a declarative language where you declare your target infrastructure in the form of configuration files and terraform records those configuration changes in the state file. … Read more

Mastering Terraform provider Meta Argument

Mastering Terraform provider Meta Argument

In today’s blog post, we will discuss terraform provider meta argument. A provider is basically a plugin that understands how to interact with a specific service (like AWS, Azure, Google Cloud, Kubernetes, GitHub, etc.). While Terraform automatically uses the default configuration for a declared provider, there are many scenarios (for example, you have multiple cloud … Read more

Mastering Terraform depends_on Meta Argument

In today’s blog post, we are going to cover terraform depends_on meta argument. Terraform internally manage dependency between resources to determine the order in which resources will get provisioned, updated, or destroyed. Terraform does this by creating a dependency graph between the resources. For example say you need to provision a server and it’s storage. … Read more

Mastering Terraform lifecycle Meta Argument

Mastering Terraform lifecycle Meta Argument

In today’s blog post, we will cover terraform lifecycle meta argument with examples, types, usage, tips, and best practices. The lifecycle meta argument is used to control how terraform manages any configuration changes for a resource, module or data source block. Without a lifecycle defined, if terraform detects any change in the configuration vs actual, … Read more

Mastering Terraform for_each Meta Argument

Mastering Terraform for_each Meta Argument

In today’s blog post, will cover terraform for_each meta argument. In particular, we will explain why we need a for_each construct, how to use for_each meta argument with examples, and what is the difference between a for_each and count meta argument. Introduction: Why for_each? Imagine you need to provision 10 identical EC2 instances. You could … Read more

Mastering Terraform count Meta Argument

In today’s blog post, we will learn terraform count meta argument. The count meta argument is used mainly for iteration (looping). For example, using count you can provision multiple resources with the same configuration block or use count with a conditional expression to execute a terraform block based on some condition. The count meta argument … Read more

Troubleshooting “Error acquiring the state lock: ConditionalCheckFailedException” in Terraform

Error acquiring the state lock ConditionalCheckFailedException

In today’s blog post, we are going to cover how to troubleshoot “Error acquiring the state lock: ConditionalCheckFailedException.” in terraform. A state file is used by Terraform to map real world resources to your configuration, keep track of metadata, and to improve performance for large infrastructures. When terraform is used by multiple users to manage the same … Read more

Advanced Filtering with Terraform Data Sources

Advanced Filtering with Terraform Data Sources

Terraform’s data sources provides a way to fetch information about your infrastructure or external data. While fetching the entire data source details are straightforward using a data source block, the real trick is when you want to get some specific information from the terraform data source block using some conditions. For example, say you have … Read more

Mastering Terraform Outputs

Terraform output is a key feature used to get and display important information about what is getting provisioned, debugging your terraform code and also to pass information from one terraform module to another. While in most cases a simple output block suffice the need to display and pass information about the infrastructure getting provisioned. Sometime … Read more