Permission error during AWS CLI configuration

Recently we have started seeing “permission denied” error when AWS CLI is being configured.

It seems like /home/circleci/.aws directory is created as root:root.

Later when aws configure is called it fails with:

(Step called “Install AWS CLI - latest” works successfully)

(Step: “Configure AWS Access Key ID“ fails)

[Errno 13] Permission denied: '/home/circleci/.aws/credentials'

Exited with code exit status 255

Image: cimg/python:2.7.18

Orb: circleci/aws-cli@5.4.1 using aws-cli/setup

As far as I can tell there are no changes on our side recently.

Seems like aws-cli orb is also not recently updated.

Perhaps something has changed in the image?

This is due to a bug in the latest version of the AWS CLI.
You can see the issue here :

To fix it you can specify the aws cli version parameter like this :

      - aws-cli/setup:
          version: "2.33.8"