Terraform

Understanding one() Function in Terraform

Understanding the behavior of Terraform's one() function. Introduction Understanding the Behavior of one() Specification of one() Examples When to Use one() Conclusion References Introduction Terraform provides a one() function. Because th…

How to Output Resources with `count` in Terraform

This post explains how to output a resource in Terraform when its creation is controlled using the count parameter. Introduction Outputting Resources Controlled by count Method 1: Use the one Function Method 2: Use the try Function Conclus…

Deploying Terraform Backend (S3/DynamoDB) with CloudFormation

This post explains the CloudFormation template that sets up the backend (S3/DynamoDB) to store Terraform state. Introduction CloudFormation Template to Provision Terraform Backend Conclusion References Introduction How to provision the bac…

How to Output DEBUG-Level Logs in Terraform

This is a quick note on how to change the log output level in Terraform. Introduction Outputting DEBUG-Level Logs in Terraform Setting Log Levels Separately for Terraform and Providers Appendix: Reading Terraform's Source Code Conclusion R…

How to Use the Ternary Operator in Terraform

This article summarizes how to use the ternary operator in Terraform, along with practical examples. Introduction Ternary Operator in Terraform How to Use Practical Examples Simple Example Combining Conditions Example of Type Casting Error…