<refsection xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="conditions-and-assertions">
  <title>CONDITIONS AND ASSERTIONS</title>
  <para>
    Conditions and assertions can be used to throw human readable
    exceptions and to create conditional terraform resources or
    parameters.
  </para>
  <refsection xml:id="mkassert">
    <title>mkAssert</title>
    <para>
      To make an assertion in your module use the
      <literal>mkAssert</literal> command. Here is an example
    </para>
    <programlisting language="bash">
config = mkAssert (cfg.parameter != &quot;fail&quot;) &quot;parameter is set to fail!&quot; {
  resource.aws_what_ever.&quot;${cfg.parameter}&quot; = {
    I = &quot;love nixos&quot;;
  };
};
</programlisting>
  </refsection>
</refsection>
