github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/internal/command/testdata/fmt/general_in.tf (about)

     1  # This test case is intended to cover many of the main formatting
     2  # rules of "terraform fmt" at once. It's fine to add new stuff in
     3  # here, but you can also add other _in.tf/_out.tf pairs in the
     4  # same directory if you want to test something complicated that,
     5  # for example, requires specific nested context.
     6  #
     7  # The input file of this test intentionally has strange whitespace
     8  # alignment, because the goal is to see the fmt command fix it.
     9  # If you're applying batch formatting to all .tf files in the
    10  # repository (or similar), be sure to skip this one to avoid
    11  # invalidating the test.
    12  
    13  terraform {
    14  required_providers {
    15  foo = { version = "1.0.0" }
    16  barbaz = {
    17              version = "2.0.0"
    18  }
    19  }
    20  }
    21  
    22  variable instance_type {
    23  
    24  }
    25  
    26  resource foo_instance foo {
    27    instance_type = "${var.instance_type}"
    28  }
    29  
    30  resource foo_instance "bar" {
    31      instance_type = "${var.instance_type}-2"
    32  }
    33  
    34  resource "foo_instance" /* ... */ "baz" {
    35    instance_type = "${var.instance_type}${var.instance_type}"
    36  
    37    beep boop {}
    38    beep blep {
    39      thingy = "${var.instance_type}"
    40    }
    41  }
    42  
    43    provider "" {
    44  }
    45  
    46  locals {
    47    name = "${contains(["foo"], var.my_var) ? "${var.my_var}-bar" :
    48      contains(["baz"], var.my_var) ? "baz-${var.my_var}" :
    49    file("ERROR: unsupported type ${var.my_var}")}"
    50    wrapped = "${(var.my_var == null ? 1 :
    51      var.your_var == null ? 2 :
    52    3)}"
    53  }