Error AtlasError Documentation and Resolution

Terraform could not convert the value to bool

Error: Invalid function argument

Terraform could not convert the supplied value to a boolean because tobool only accepts booleans, null, or the exact strings true and false.

Invalid function argumentconfiguration
Error: Invalid function argument
  • The expression passes a string like no, yes, or another unsupported value to tobool.
  • The function receives a number, collection, or other non-boolean-compatible type.
  • Input normalization assumes Terraform can coerce values that tobool rejects.
  1. Validate the input before calling tobool and pass only supported boolean-like values.
  2. Normalize upstream variables so they are already bool values when possible.
  3. Use explicit branching logic if the input space includes values beyond true, false, or null.
tobool function
Terraform Invalid function argument with tobool: causes and fixes | Error Atlas