cloudposse / cloudposse/docs

How does terraform handle booleans?

Open
#342 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
99
Forks
34
PR merge metrics
No merged PRs in 30d

Description

## What

* Document why in terraform booleans should be expressed as type `string` rather than type `boolean`.

## Why

* The boolean default value `true` does not work *consistently* as expected and will in some cases be converted to `false`.

* Terraform recommends using explicit strings instead of boolean values

> Although it appears Terraform supports boolean types, they are instead silently converted to string types. The implications of this are subtle and should be completely understood if you plan on using boolean values. It is instead recommended you avoid using boolean values for now and use explicit strings. A future version of Terraform will properly support booleans and using the current behavior could result in backward-incompatibilities in the future.

## References

* https://www.terraform.io/docs/configuration/variables.html#booleans

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.