Skip to content

Feature Request: Multiline condition support like in bash or python #766

@dylanf9797

Description

@dylanf9797

Hi

Currently, multiline condition is not supported and i think it can be good to have this feature.

Let's take an example

this works using Bash
test.sh

[ -f /tmp/a ] && \
  [ -f /tmp/b ] && { echo yes; } \
  || echo no

and this works in python:
test.py

t = 1
s = "hellos"

if 2 > t and \
        s == "hello":
    print("ok")
else:
    print("no")

But this not works in terraform for example:

# variables.tf

variable "hello" {
  type = string
  validation {
    condition = length(var.hello) > 0 && \
      length(var.hello) < 128

    error_message = "NO"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions