github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/configs/configupgrade/testdata/valid/redundant-list/input/redundant-list.tf (about)

     1  variable "listy" {
     2    type = "list"
     3  }
     4  
     5  resource "test_instance" "other" {
     6    count = 2
     7  }
     8  
     9  resource "test_instance" "bad1" {
    10    security_groups = ["${test_instance.other.*.id}"]
    11  }
    12  
    13  resource "test_instance" "bad2" {
    14    security_groups = ["${var.listy}"]
    15  }
    16  
    17  resource "test_instance" "bad3" {
    18    security_groups = ["${module.foo.outputs_always_dynamic}"]
    19  }
    20  
    21  resource "test_instance" "bad4" {
    22    security_groups = ["${list("a", "b", "c")}"]
    23  }
    24  
    25  resource "test_instance" "bad5" {
    26    security_groups = ["${test_instance.bad1.subnet_ids}"] # this one references a set
    27  }
    28  
    29  resource "test_instance" "bad6" {
    30    subnet_ids = ["${test_instance.bad1.security_groups}"] # this one defines a set
    31  }
    32  
    33  resource "test_instance" "bad7" {
    34    subnet_ids = ["${test_instance.bad1.*.id}"] # this one defines a set
    35  }
    36  
    37  # The rest of these should keep the same amount of list-ness
    38  
    39  resource "test_instance" "ok1" {
    40    security_groups = []
    41  }
    42  
    43  resource "test_instance" "ok2" {
    44    security_groups = ["notalist"]
    45  }
    46  
    47  resource "test_instance" "ok3" {
    48    security_groups = ["${path.module}"]
    49  }
    50  
    51  resource "test_instance" "ok4" {
    52    security_groups = [["foo"], ["bar"]]
    53  }
    54  
    55  resource "test_instance" "ok5" {
    56    security_groups = "${test_instance.other.*.id}"
    57  }
    58  
    59  resource "test_instance" "ok6" {
    60    security_groups = [
    61      "${test_instance.other1.*.id}",
    62      "${test_instance.other2.*.id}",
    63    ]
    64  }