New to Kestra?
Use blueprints to kickstart your first workflows.
Provision AWS Batch and ECS Fargate with Terraform, parse the outputs, and run parallel Python workloads on serverless compute, all in one Kestra flow.
Run high-performance, massively parallel Python workloads on AWS Batch backed by ECS Fargate, with all the underlying cloud infrastructure provisioned automatically by Terraform. This blueprint closes the gap between infrastructure as code and compute orchestration: a single Kestra flow clones the Terraform definitions, applies them to stand up an AWS Batch compute environment, job queue, and ECS task roles, then immediately runs Python scripts on that freshly provisioned Batch backend. No manual server, cluster, or container management, and no copy-pasting ARNs between tools.
io.kestra.plugin.core.flow.WorkingDirectory task wraps the provisioning steps so cloned files and Terraform state stay together.io.kestra.plugin.git.Clone pulls the kestra-io/deployment-templates repository (branch main) containing the Terraform configuration for AWS Batch.io.kestra.plugin.terraform.cli.TerraformCLI injects a generated backend.tf (S3 remote state keyed on the bucket and region inputs), then runs terraform init, terraform apply -auto-approve, and writes terraform output to output.txt. AWS credentials and TF_VAR_* values are passed via env.io.kestra.plugin.scripts.python.Script (task parse_tf_output) reads output.txt and emits the Terraform outputs as Kestra outputs using the Kestra.outputs() SDK helper.io.kestra.plugin.core.flow.Parallel runs two Python tasks (run_command and run_python_script) at the same time, each using the io.kestra.plugin.ee.aws.runner.Batch task runner wired to the parsed computeEnvironmentArn, jobQueueArn, executionRoleArn, and taskRoleArn.Terraform provisions infrastructure but has no scheduler, no retries, and no built-in way to pass its outputs into a running compute job. Kestra adds event and schedule triggers, automatic retries, and full execution lineage across the provision-then-run sequence. Everything is declarative YAML, so the Git clone, the Terraform apply, the output parsing, and the parallel Batch jobs live in one auditable flow instead of being stitched together by hand.
bucket and region inputs).io.kestra.plugin.ee.aws.runner.Batch).AWS_ACCESS_KEY_ID: AWS access key for Terraform and the Batch task runner.AWS_SECRET_KEY_ID: AWS secret access key for Terraform and the Batch task runner.AWS_ACCESS_KEY_ID and AWS_SECRET_KEY_ID secrets to your namespace or environment.bucket and region inputs to match your S3 state backend.Parallel task or use ForEach to fan out over a list of inputs.io.kestra.plugin.git.Clone at your own Terraform repository to provision different infrastructure.terraform destroy.