variable "target_region" {
description = "Explicit deployment region (optional)"
type = string
default = null
}
variable "default_region" {
description = "Fallback region from team defaults (optional)"
type = string
default = null
}
computed "region" {
description = "Resolved deployment region"
expression = coalesce(var.target_region, var.default_region, "us-east-1")
}
task "deploy" {
description = "Deploy to the resolved region"
commands = ["aws ecs update-service --region ${computed.region} --cluster prod --service api --force-new-deployment"]
}