Skip to content

Instantly share code, notes, and snippets.

@thatderek
Created March 23, 2017 17:40
Show Gist options
  • Select an option

  • Save thatderek/22c068d8857e6770708eb10dec93d2b1 to your computer and use it in GitHub Desktop.

Select an option

Save thatderek/22c068d8857e6770708eb10dec93d2b1 to your computer and use it in GitHub Desktop.

Revisions

  1. thatderek created this gist Mar 23, 2017.
    9 changes: 9 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    variable "manual_foos_list" {
    default = []
    }

    resource "bar" "n" {
    count = "3"

    foo = "${length(var.manual_foos_list) > 0 ? element(var.manual_foos_lists, count.index) : element(data.foos.*.id, count.index)}"
    }