terraform terraform_data - ghdrako/doc_snipets GitHub Wiki

Zastepuje null resource od terraform 1.4

resource "aws_instance" "web" {
  # ...
}

resource "aws_instance" "database" {
  # ...
}


resource "terraform_data" "bootstrap" {
  triggers_replace = [
    aws_instance.web.id,
    aws_instance.database.id
  ]

  provisioner "local-exec" {
    command = "bootstrap-hosts.sh"
  }
}