If you are experiencing AWS authentication errors despite having provided the correct AWS credentials in your project or context environment variables (e.g. AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID or other means as documented in https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html), this may be caused by AWS credentials previously set for the project in a legacy settings page.
To verify if this is the case, you can still access the legacy settings page by:
- Clicking the "Old Experience" link on the left side, which will take you to the legacy UI.
- Directly visiting the legacy settings page URL, which will be in the format https://circleci.com/<gh|bb>/<org name>/<project name>/edit#aws
(For example, for the CircleCI-Public/circleci-demo-workflows GitHub project, the URL to directly access the legacy page would be: https://circleci.com/gh/CircleCI-Public/circleci-demo-workflows/edit#aws)
We strongly recommend clearing any values found on this legacy page, so that they will not unexpectedly interfere with authenticating to AWS in your builds.
Note: The legacy settings page is subject to being completely taken offline in the future; the steps in this article will then no longer be applicable.