Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created June 12, 2023 15:57
Show Gist options
  • Save anna-geller/f4642f4e85ee3cc9f344011ee4e6633b to your computer and use it in GitHub Desktop.
Save anna-geller/f4642f4e85ee3cc9f344011ee4e6633b to your computer and use it in GitHub Desktop.
Deploy all flows that exist in the flows directory
terraform {
required_providers {
kestra = {
source = "kestra-io/kestra"
version = "~> 0.7.0"
}
}
}
provider "kestra" {
url = "http://localhost:8080"
}
resource "kestra_flow" "flows" {
keep_original_source = true
for_each = fileset(path.module, "flows/*.yml")
flow_id = yamldecode(templatefile(each.value, {}))["id"]
namespace = yamldecode(templatefile(each.value, {}))["namespace"]
content = templatefile(each.value, {})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment