assertion

Invicton-Labs/assertion/null

Terraform Module HCL NULL

A simple module that asserts (during planning) that a condition is true, and prints a custom error message if not.

Install
module "assertion" {
source = "Invicton-Labs/assertion/null"
version = "0.2.8"
}
plain text: /constructs/tfmod-invicton-labs-assertion-null/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform Assertion A simple module that asserts that one or more conditions are true. The assertion is checked during planning, unless the condition depends on a value that will only be known during apply. The module forces Terraform to fail if the condition is false by using a Terraform variable with a validation condition, with the desired error message as the variable validation error message. Usage `` module "assertion_unix_only" { source = "Invicton-Labs/assertion/null" // The condition to ensure is TRUE // In this example, assert that the operating system uses forward slashes for path separators condition = dirname("/") == "/" // The error message to print out if the condition evaluates to FALSE error_message = "This Terraform configuration can only be run on Unix-based machines." }

Inputs (3)
NameTypeDescriptionDefault
error_messagestringThe error message to display if the condition evaluates to `false`.null
conditionboolThe condition to ensure is `true`.null
assertionslist(object({ condition A list of conditions and error message pairs to check. This is for use when you null
Outputs (4)
error_message — The value of the `error_message` input variable.
condition — The value of the `condition` input variable.
assertions — The value of the `assertions` input variable.
checked — Whether the condition has been checked (used for assertion dependencies).
Details
FrameworkTerraform Module
LanguageHCL
Version0.2.8
Cloud NULL
Total downloads8.9M
Inputs3
Outputs4
Examples1
NamespaceInvicton-Labs
Updated