Gintautas Jankus
06/15/2022, 1:05 PMAn error occurred (AccessDeniedException) when calling the RegisterTaskDefinition operation: User: is not authorized to perform: ecs:RegisterTaskDefinition on resource: * because no identity-based policy allows the ecs:RegisterTaskDefinition action
I have tried also to pass flow_a task_definition_arn to parent_flow, then it runs flow, but gets this error:`in create_flow_run ValueError: Received both flow_id
and flow_name
. Only one flow identifier can be passed.` Maybe someone can share the best practices how I could create flow that would run in order these two already registered flows ? Big thanks in advance ! 🙂Kevin Kho
06/15/2022, 1:08 PMGintautas Jankus
06/15/2022, 1:24 PMFLOW_STORAGE_S3_BUCKET = S3(bucket="simple_bucket")
PROJECT_NAME = "default"
LABELS = ["ecs"]
FLOW_A_RUN_CONFIG = ECSRun(
task_definition_arn="flow_a_arn",
labels=LABELS,
)
FLOW_B_RUN_CONFIG = ECSRun(
task_definition_arn="flow_b_arn",
labels=LABELS,
)
def workflow() -> Flow:
with Flow("parent_flow", storage=FLOW_STORAGE_S3_BUCKET) as flow:
flow_a = create_flow_run(
flow_name="flow_a", project_name=PROJECT_NAME, run_config=FLOW_A_RUN_CONFIG
)
wait_for_flow_a = wait_for_flow_run(flow_a, raise_final_state=True)
flow_b = create_flow_run(
flow_name="flow_b", project_name=PROJECT_NAME, run_config=FLOW_B_RUN_CONFIG
)
wait_for_flow_b = wait_for_flow_run(flow_b, raise_final_state=True)
flow_b.set_upstream(wait_for_flow_a)
return flow
if __name__ == "__main__":
flow = workflow()
flow.register(project_name=PROJECT_NAME, labels=LABELS)
Yes, most likely these RunConfigs is not necessary, although I thought that I could somehow avoid creating new task definition as those two separate flows already have their task definitions, but probably will not avoid it and will need to give extra permissions. Thank you 🙂