Terraform
Null Known Value Checks
The known value checks that are available for null values are:
Null
Check
The Null check tests that a resource attribute, or output value has an exactly matching null value.
Example usage of Null in an ExpectKnownValue state check.
func TestExpectKnownValue_CheckState_AttributeValueNull(t *testing.T) {
t.Parallel()
r.Test(t, r.TestCase{
// Provider definition omitted.
Steps: []r.TestStep{
{
// Example resource containing a computed attribute named "computed_attribute"
Config: `resource "test_resource" "one" {}`,
ConfigStateChecks: []statecheck.StateCheck{
statecheck.ExpectKnownValue(
"test_resource.one",
tfjsonpath.New("computed_attribute"),
knownvalue.Null(),
),
},
},
},
})
}