Brendan Couche
01/31/2023, 9:50 PMbotocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the DescribeTaskDefinition operation: User: arn:aws:sts::<ACCT>:assumed-role/<ROLE> is not authorized to perform: ecs:DescribeTaskDefinition on resource: * because no identity-based policy allows the ecs:DescribeTaskDefinition action
ecs:DescribeTaskDefinition
access from all resources down to the task definition for the ephemeral jobs and with the task definition to launch manually specified in my EcsRunLauncher
config. Has anyone had any luck pulling the scope in? Is there a reason Dagster should need access ecs:DescribeTaskDefinition
access to all resources that I'm not seeing? I'm able to proceed for the moment by opening access up again, but DevOps here is less than thrilledDescribeTaskDefinition
requests. Thanks @daniel for the help 🙂daniel
01/31/2023, 10:01 PMBrendan Couche
01/31/2023, 10:04 PMFile "/opt/venv/lib/python3.10/site-packages/dagster_graphql/implementation/utils.py", line 125, in _fn
return fn(*args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 29, in launch_pipeline_reexecution
return _launch_pipeline_execution(graphene_info, execution_params, is_reexecuted=True)
File "/opt/venv/lib/python3.10/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 72, in _launch_pipeline_execution
run = do_launch(graphene_info, execution_params, is_reexecuted)
File "/opt/venv/lib/python3.10/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 56, in do_launch
return graphene_info.context.instance.submit_run(
File "/opt/venv/lib/python3.10/site-packages/dagster/_core/instance/__init__.py", line 1913, in submit_run
submitted_run = self._run_coordinator.submit_run(
File "/opt/venv/lib/python3.10/site-packages/dagster/_core/run_coordinator/default_run_coordinator.py", line 34, in submit_run
self._instance.launch_run(pipeline_run.run_id, context.workspace)
File "/opt/venv/lib/python3.10/site-packages/dagster/_core/instance/__init__.py", line 1966, in launch_run
self.run_launcher.launch_run(LaunchRunContext(pipeline_run=run, workspace=workspace))
File "/opt/venv/lib/python3.10/site-packages/dagster/_core/instance/__init__.py", line 659, in run_launcher
launcher = cast(InstanceRef, self._ref).run_launcher
File "/opt/venv/lib/python3.10/site-packages/dagster/_core/instance/ref.py", line 491, in run_launcher
return self.run_launcher_data.rehydrate() if self.run_launcher_data else None
File "/opt/venv/lib/python3.10/site-packages/dagster/_serdes/config_class.py", line 101, in rehydrate
return klass.from_config_value(self, check.not_none(result.value))
File "/opt/venv/lib/python3.10/site-packages/dagster_aws/ecs/launcher.py", line 277, in from_config_value
return EcsRunLauncher(inst_data=inst_data, **config_value)
File "/opt/venv/lib/python3.10/site-packages/dagster_aws/ecs/launcher.py", line 125, in __init__
task_definition = self.ecs.describe_task_definition(taskDefinition=self.task_definition)
File "/opt/venv/lib/python3.10/site-packages/botocore/client.py", line 508, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/opt/venv/lib/python3.10/site-packages/botocore/client.py", line 915, in _make_api_call
raise error_class(parsed_response, operation_name)
And this is on 1.1.14
daniel
01/31/2023, 10:04 PMBrendan Couche
01/31/2023, 10:05 PMstatement {
sid = "TaskDefinitionPermissions"
actions = [
"ecs:DescribeTaskDefinition"
]
resources = [
"arn:aws:ecs:us-west-2:${local.account_id}:task-definition/${var.env}-dagster-job:*"
]
}
daniel
01/31/2023, 10:07 PMBrendan Couche
01/31/2023, 10:08 PM{
"name": "DAGSTER_JOB_TASK_DEFINITION",
"value": "arn:aws:ecs:us-west-2:<ACCT>:task-definition/dev-dagster-job:15"
}
{
"Action": "ecs:DescribeTaskDefinition",
"Effect": "Allow",
"Resource": "arn:aws:ecs:us-west-2:<ACCT>:task-definition/dev-dagster-job:*",
"Sid": "TaskDefinitionPermissions"
}
daniel
01/31/2023, 10:09 PMimport boto3
boto3.client("ecs").describe_task_definition(taskDefinition="arn:aws:ecs:us-west-2:<ACCT>:task-definition/dev-dagster-job:15")
Brendan Couche
01/31/2023, 10:11 PMdaniel
01/31/2023, 10:12 PMtask_definition = self.ecs.describe_task_definition(taskDefinition=self.task_definition)
Brendan Couche
01/31/2023, 10:14 PMboto3
calldaniel
01/31/2023, 10:16 PMBrendan Couche
01/31/2023, 10:17 PMdaniel
01/31/2023, 10:17 PMBrendan Couche
01/31/2023, 10:18 PMdaniel
01/31/2023, 10:19 PMBrendan Couche
01/31/2023, 11:11 PM