Credential named assume-role-with-web-identity not found

Viewed 5613

On my amazon linux ec2 instance, I have the iam-role attached with proper permission, I ran the command $ sudo yum update . After this I started getting the error Credential named assume-role-with-web-identity not found for command aws s3 ls. But if I add sudo and run the command sudo aws s3 ls then it works fine.

Please help me to find the issue. Thanks in advance.

6 Answers

Downgraded the version of aws-cli and it got fixed. commands used:

$ curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip -o awscli-bundle.zip
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/bin/aws

I had the same issue on macOS. Upgrading both botocore and awscli did the trick:

pip3 install --upgrade botocore awscli

To downgrade the ubuntu package, you can use:

$ apt-cache madison awscli
    awscli | 1.18.69-1ubuntu0.18.04.1 | http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
    awscli | 1.18.69-1ubuntu0.18.04.1 | http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
    awscli | 1.14.44-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
    awscli | 1.14.44-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages

Then select the correct one and install using apt-get:

$ sudo apt-get install awscli=1.14.44-1ubuntu1 -V
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be DOWNGRADED:
   awscli (1.18.69-1ubuntu0.18.04.1 => 1.14.44-1ubuntu1)
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 482 kB of archives.
After this operation, 4,870 kB disk space will be freed.
Do you want to continue? [Y/n]

I had this same issue on an image that had installed botocore separately from awscli and that was the version (botocore 1.12.172) it seemed to be picking up. Once I upgraded to botocore 1.12.200 and run the image build again, it resolved this issue above.

pip install botocore==1.12.200
{ brew | apt-get }  install awscli

This should resolve the issue above without having to downgrade awscli.

See also: https://github.com/aws/aws-cli/issues/4371

Related