open-nomad/e2e/remotetasks/input/ecs.nomad
Michael Schurter e62795798d core: propagate remote task handles
Add a new driver capability: RemoteTasks.

When a task is run by a driver with RemoteTasks set, its TaskHandle will
be propagated to the server in its allocation's TaskState. If the task
is replaced due to a down node or draining, its TaskHandle will be
propagated to its replacement allocation.

This allows tasks to be scheduled in remote systems whose lifecycles are
disconnected from the Nomad node's lifecycle.

See https://github.com/hashicorp/nomad-driver-ecs for an example ECS
remote task driver.
2021-04-27 15:07:03 -07:00

44 lines
905 B
HCL

variable "subnets" {
type = list(string)
description = "Subnet IDs task will run in."
}
variable "security_groups" {
type = list(string)
description = "Security Group IDs task will run in."
}
job "nomad-ecs-e2e" {
datacenters = ["dc1"]
group "ecs-remote-task-e2e" {
restart {
attempts = 0
mode = "fail"
}
reschedule {
delay = "5s"
}
task "http-server" {
driver = "ecs"
kill_timeout = "1m" // increased from default to accomodate ECS.
config {
task {
launch_type = "FARGATE"
task_definition = "nomad-rtd-e2e"
network_configuration {
aws_vpc_configuration {
assign_public_ip = "ENABLED"
security_groups = var.security_groups
subnets = var.subnets
}
}
}
}
}
}
}