Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CLI in Windows EC2 cannot use role to access S3

I am very new to AWS. I created an IAM role which has full access to S3. I assigned this role to a Windows Server EC2 instance. I then installed CLI on that instance. I then remoted into that instance using RDP, and started a CMD windows, and typed in

aws s3 ls

It complained that

Unable to locate credentials. You can configure credentials by running "aws configure".

Now that this EC2 has been assigned the role that has full access to S3, why can't I directly access S3?

like image 726
Silly Dude Avatar asked Mar 08 '23 22:03

Silly Dude


1 Answers

To use AWS CLI with IAM Roles, you create a named profile. Instead of configuring this profile with credentials, you specify the ARN of the role and the name of the profile that has access to it.

like image 90
Ashan Avatar answered Mar 16 '23 01:03

Ashan