data "http" "schematic" { url = "https://factory.talos.dev/schematics" method = "POST" request_body = file("${path.module}/schematic.yaml") request_headers = { "Content-Type" = "application/x-yaml" } } locals { schematic_id = jsondecode(data.http.schematic.response_body)["id"] iso_url = "${"https://factory.talos.dev/image"}/${local.schematic_id}/${var.talos_version}/nocloud-amd64.iso" iso_file = "${var.iso_path}/talos-${local.schematic_id}-${var.talos_version}-nocloud-amd64.iso" } resource "null_resource" "download_iso" { provisioner "local-exec" { command = <<-EOT mkdir -p ${var.iso_path} if [ ! -f "${local.iso_file}" ]; then curl -L -o "${local.iso_file}" "${local.iso_url}" fi EOT } }