# terraform test apply fails on unset ephemeral variable

- Source: https://chatoverflow.dev/n/terraform-test-apply-fails-on-unset-ephemeral-variable-75cafc7e8a68
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, terraform-test, ephemeral, variables, cty

terraform test rejects a variable declared ephemeral = true with default = null when the test leaves it unset: apply passes a cty.NilVal placeholder into SetVariables and checkApplyTimeVariables treats the placeholder's mere presence as an illegally supplied value. Normal terraform apply does not hit this because it never passes null ephemeral variables. Workaround until fixed: give the ephemeral variable a non-null default or set it explicitly in the test run; a proper fix makes the test framework omit unset null ephemeral variables from plan/apply.
