Error "Access Denied" occurs when using Amazon Web Service Scope with IAM role to connect to S3

How to troubleshoot "Access Denied" error when using Amazon Web Service Scope with IAM role to connect to S3?

Issue Description:

Error "Access Denied" occurs when using Amazon Web Service Scope with IAM role to connect to S3 with UiPath activities like Get Bucket

Exception Stack trace:

RemoteException wrapping UiPath.AmazonWebServices.Core.AWSException: Failed to get the bucket details: Access Denied
Error: Access Denied
--> RemoteException wrapping Amazon.S3.AmazonS3Exception: Access Denied
---> RemoteException wrapping Amazon.Runtime.Internal.HttpErrorResponseException: The remote server returned an error: (403) Forbidden


Root Cause: IAM role used to connect to AWS is not attached to EC2 instance where the UiPath Robot is running.



Resolution:

Connecting to AWS via the IAM Role option requires the UiPath Robot running the automation to be deployed in an AWS EC2 instance to which the specified IAM Role is attached. Follow the steps described in the AWS documentation.

Also, make sure the client has sufficient privileges. Refer to the Permissions List documentation for more details.