In a fictional service, settlements starts successfully and then gets AccessDenied from SQS. The task definition ARN from the affected running task lets you inspect both roles for that revision.
aws ecs describe-task-definition --task-definition settlements:42 \
--query 'taskDefinition.{application:taskRoleArn,execution:executionRoleArn}'
The audit event records a session of settlements-task. Compare its requested queue and operation with the task role's grants and the queue policy. An SDK with explicit credentials can use a different role, so use the audit event when it disagrees with the task definition. If the failure happened before the app started, match the ECS initialization error to the agent's operation instead. ECS task IAM role · ECS task execution role · DescribeTaskDefinition
For a failure during secret injection, see ECS secret startup errors.