Carter Kwon
08/17/2021, 10:07 PM[INACTIVE]
. It's particularly strange because the inactive task definition shows "none" for the task role, but there is a role attached. I'll add a screenshot in the thread. The flow finishes successfully and writes to an s3 bucket that requires the role permissions. Any ideas what could be happening?Carter Kwon
08/17/2021, 10:07 PMKevin Kho
Carter Kwon
08/17/2021, 10:19 PMflow.run_config = ECSRun(
task_role_arn=os.getenv("TASK_ROLE_ARN"),
execution_role_arn=os.getenv("EXECUTION_ROLE_ARN"),
)
The rest of the task definition settings are set on the agent using this terraform block
resource "aws_ecs_task_definition" "agent_definition" {
family = "etl-prefect-${var.prefect_cluster}-agent"
task_role_arn = aws_iam_role.agent_role.arn
execution_role_arn = aws_iam_role.agent_execution_role.arn
network_mode = "awsvpc"
cpu = "256"
memory = "512"
requires_compatibilities = ["FARGATE"]
container_definitions = jsonencode([
{
"image" : "prefecthq/prefect:latest",
"name" : "agent",
"logConfiguration" : {
"logDriver" : "awslogs",
"secretOptions" : null,
"options" : {
"awslogs-group" : "/ecs/etl-prefect-${var.prefect_cluster}-agent",
"awslogs-region" : "us-west-2",
"awslogs-stream-prefix" : "ecs"
}
},
"entryPoint" : null,
"portMappings" : [],
"secrets" : [
{
"name" : "TOKEN",
"valueFrom" : "${aws_ssm_parameter.ecs_token.arn}"
}
],
"entryPoint" = [
"sh",
"-c"
],
"command" : [
join(" ", ["sh", "-c",
<<-COMMANDBLOCK
'cat > run_task_kwargs.yaml <<EOF
networkConfiguration:
awsvpcConfiguration:
assignPublicIp: DISABLED
securityGroups:
- ${aws_security_group.agent_sg.id}
subnets:
- ${tolist(data.aws_subnet_ids.private.ids)[0]}
- ${tolist(data.aws_subnet_ids.private.ids)[1]}
EOF
prefect agent ecs start --cluster ${aws_ecs_cluster.prefect_tasks.arn} --token $TOKEN --label ${var.prefect_cluster} --run-task-kwargs ./run_task_kwargs.yaml'
COMMANDBLOCK
])]
}
])
}
Kevin Kho
Carter Kwon
08/17/2021, 10:26 PMKevin Kho
Carter Kwon
08/17/2021, 10:30 PMKevin Kho
Carter Kwon
08/17/2021, 11:15 PMCarter Kwon
08/17/2021, 11:16 PMCarter Kwon
08/17/2021, 11:18 PMCarter Kwon
08/19/2021, 9:41 PMCarter Kwon
08/19/2021, 9:48 PMprefecthq/prefect:latest
image so it probably get a newer version of prefect.
• Every time I click "run" in Prefect, a new task definition is created even though a new flow version wasn't registered
• When a flow is running in ECS, the running task details page (not the task definition) shows the appropriate role attached. However, the task definition for that running task still shows "None" for the task role.Kevin Kho
Carter Kwon
08/19/2021, 9:53 PMClient was created with an API token configured for authentication. API tokens are deprecated, please use API keys instead.
I'll try using the new service account authentication and see if that changes thingsKevin Kho
Carter Kwon
08/19/2021, 10:03 PM--key <key>
and it got rid of the deprecated token warning, but not the [INACTIVE] task definition problem.Carter Kwon
08/19/2021, 10:03 PM0.15.3
Kevin Kho
Carter Kwon
08/25/2021, 2:03 AMKevin Kho
Carter Kwon
08/25/2021, 3:28 AMKevin Kho
Kevin Kho
Carter Kwon
08/25/2021, 3:57 AMKevin Kho