Why DVC not working with AWS role on AWS Batch?

I’m using DVC on AWS Batch, and have configured the job definition with a role with correct S3 policies (I know its correct because it worked on github actions). But, when running the job with dvc pull I got this error:

dvc pull -R /app/data/training
ERROR: unexpected error - Forbidden: An error occurred (403) when calling the HeadObject operation: Forbidden

The same job, if runned with the envs AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY configured, runs ok.

I’m using DVC on AWS Batch, and have configured the job definition with a role with correct S3 policies (I know its correct because it worked on github actions).

I’m sorry I’m not familiar with AWS Batch, could you please elaborate on how do you set your S3 credentials in it?

And excuse me , Any more details on this?

  1. If possible the info from dvc doctor.
  2. Some more detailed logs from dvc pull -R /app/data/training.