title: Terraform - Conditional expression for a AWS role
body: <p>I have the following in my module to create a role:</p>
  <pre><code>resource &quot;aws_iam_role&quot; &quot;default&quot; {
  
    name                 = var.name
  
    assume_role_policy   = var.assume_role_policy
  
    permissions_boundary = var.account_id != &quot;&quot; ? var.permissions_boundary : &quot;arn:aws:iam::${data.aws_caller_identity.default.account_id}:policy/BoundedPermissionsPolicy&quot;
  
  }
  </code></pre>
  <p>Problem - I want to be able to set the permissions boundary argument to use the account ID if present and if not specified then make use of var.permissions_boundary (<code>arn:aws:iam::${data.aws_caller_identity.default.account_id}:policy/BoundedPermissionsPolicy</code>).
  The code above does not work when I try to use the account ID.</p>