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