e62795798d
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.
30 lines
795 B
HCL
30 lines
795 B
HCL
# Nomad ECS Remote Task Driver E2E
|
|
resource "aws_ecs_cluster" "nomad_rtd_e2e" {
|
|
name = "nomad-rtd-e2e"
|
|
}
|
|
|
|
resource "aws_ecs_task_definition" "nomad_rtd_e2e" {
|
|
family = "nomad-rtd-e2e"
|
|
container_definitions = file("ecs-task.json")
|
|
|
|
# Don't need a network for e2e tests
|
|
network_mode = "awsvpc"
|
|
|
|
requires_compatibilities = ["FARGATE"]
|
|
cpu = 256
|
|
memory = 512
|
|
}
|
|
|
|
data "template_file" "ecs_vars_hcl" {
|
|
template = <<EOT
|
|
security_groups = ["${aws_security_group.primary.id}"]
|
|
subnets = ["${data.aws_subnet.default.id}"]
|
|
EOT
|
|
}
|
|
|
|
resource "local_file" "ecs_vars_hcl" {
|
|
content = data.template_file.ecs_vars_hcl.rendered
|
|
filename = "${path.module}/../remotetasks/input/ecs.vars"
|
|
file_permission = "0664"
|
|
}
|