Fargate with logstash container consume iam role

Hi

I tried to set up logstash in AWS ECS fargate and the logstash will read from the s3 bucket.

I configuring logstash input s3 with access_key_id => ''" secret_access_key => ''" and able to read s3 files successfully.

How do I configure fargate logstash (without EC2) to use the IAM role to avoid using access and secret key?

I tried to set it empty and set the ECS task role and task execution with sts:assumerole and all required permission but getting

Error: unable to sign request without credentials set
Exception: Aws::Errors::MissingCredentialsError

Any advice for this scenario