Skip to content

Terraform

Deploy Strands Decider with Terraform if you’d rather not run CDK, or you need the same recipe across different cloud providers or on-prem. There is no SDK module yet — this page shows the shape so you can wire your own.

Decider serves plain HTTP (strands-decider serve), so the Terraform shape is the usual one: build a container image, push it to a registry, and point your compute at it.

  • When to pick it: you already use Terraform for your stack; you want the same deploy against more than one cloud provider; you need to layer Decider into existing VPCs, IAM, or networking you control with Terraform.

Decider is a pip install plus strands-decider serve; package that into a container and push it to your cloud provider’s container registry:

FROM python:3.12-slim
RUN pip install --no-cache-dir strands-decider
EXPOSE 8000
CMD ["strands-decider", "serve", \
"StrandsAgents/strands-decider-E2B-gemma4-v1-2610", \
"--port", "8000"]

Build --platform linux/amd64 for most cloud hosts; use a GPU-capable base and host for the Gemma 4 12B / 26B-A4B models (designs/inference).

The most portable Terraform target: ECS with a Fargate task running the container, fronted by a public ALB.

terraform {
required_providers {
aws = { source = "hashicorp/aws", version = "~> 5.0" }
}
}
provider "aws" {
region = var.aws_region
}
resource "aws_ecs_cluster" "decider" {
name = "strands-decider"
}
resource "aws_cloudwatch_log_group" "decider" {
name = "/ecs/strands-decider"
retention_in_days = 7
}
resource "aws_ecs_task_definition" "decider" {
family = "strands-decider"
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
cpu = "2048"
memory = "8192"
execution_role_arn = aws_iam_role.ecs_execution.arn
container_definitions = jsonencode([{
name = "decider"
image = var.decider_image
portMappings = [{ containerPort = 8000, hostPort = 8000 }]
logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-group = aws_cloudwatch_log_group.decider.name
awslogs-region = var.aws_region
awslogs-stream-prefix = "decider"
}
}
}])
}
resource "aws_ecs_service" "decider" {
name = "strands-decider"
cluster = aws_ecs_cluster.decider.id
task_definition = aws_ecs_task_definition.decider.arn
launch_type = "FARGATE"
desired_count = 1
network_configuration {
subnets = var.subnet_ids
security_groups = [aws_security_group.decider.id]
assign_public_ip = true
}
}

Wire an ALB target group at port 8000 for public access, or front it with API Gateway + a VPC Link if you want IAM-authenticated requests. Hit POST /v1/systemone once the service is healthy — same request shape as Local.

VariablePurpose
decider_imageThe image URI in ECR (or a public registry)
aws_regionThe region to deploy into
subnet_idsSubnets for the Fargate task (two in different AZs for the ALB)

Same pattern, different resources — pick the module that matches your cloud provider:

  • Serverless container service — a single resource per provider (google_cloud_run_v2_service, azurerm_container_app, etc.); set a minimum instance count to keep a warm replica, or let it scale to zero for bursty traffic.
  • Managed Kubernetes — kubernetes_deployment + kubernetes_service with a GPU node pool for the larger models.
  • Bare metal — any Linux VM; a null_resource with a remote-exec provisioner to run strands-decider serve under systemd works.
Terminal window
terraform init
terraform plan
terraform apply

Rebuild the image and re-apply when the Decider version you serve changes. terraform destroy removes the stack.