Skip to content

Instantly share code, notes, and snippets.

@anakaiti
Created August 12, 2019 05:02
Show Gist options
  • Save anakaiti/2c400683e717cd9053ffd48b73eb1c43 to your computer and use it in GitHub Desktop.
Save anakaiti/2c400683e717cd9053ffd48b73eb1c43 to your computer and use it in GitHub Desktop.
Terraform unique list
locals {
listA = [1, 2, 3, 4]
listB = [2, 3, 4, 5]
}
provider "local" {}
resource "local_file" "name" {
content = "${join(" ", distinct(concat(local.listA, local.listB)))}"
filename = "myfile.txt"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment