1
votes

I have an admin account for AWS, and am attempting to access AWS S3 using the aws-cli so that I can develop a script file to create back-ups. I have verified my Access Key and Secret Key are valid by setting up Cloudberry in parallel. Using Cloudberry, I am able to access the AWS S3 bucket where the back-ups will be placed.

Whenever I attempt to access aws s3 using the aws-cli, I receive an error. Example:

aws s3 ls
results in:

An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation: The AWS Access Key ID you provided does not exist in our records.

I have tried the following with no different result: 1. Setting up a separate profile than the default

  1. Rotating the access key and secret key

  2. Re-configuring the default profile and hand typing in the Access Key and Secret Key

  3. Running the command aws sts get-caller-identity

What may be causing this issue? What else may I be able to try to get around this roadblock?

---- Additional Details ----
I have verified that the aws folder containing the executable and the hidden folder containing the configuration/credentials are both added to the path variables.

I have run the aws s3 ls --debug command also, and the credentials file is shared. The http request ("Sending http request: https://s3.amazonaws.com/,...") goes out with the expected Access and Secret Key. Then a new HTTPs connection is started, and the next line is ("https://s3.amazonaws.com:443 "GET / HTTP/1.1" 403 None"). The response body then returns with the error shared earlier.

1
Have you run aws configure on cli? - Pacifist
As per your other question, it seems like the AWS CLI is not using the credentials you are supplying. OR, it might be that the AWS CLI is not connecting with AWS. Have you got anything configuration, such as supplying a different endpoint, perhaps to a non-AWS company? - John Rotenstein
try to remove ~/.aws/credentials and ~/.aws/config then run the command you will get the actual error. once this done then reconfigure aws configure do not type access key and secret use copy-paste then aws sts get-caller-identity - Adiii
I have run aws configure to set the access key and secret. How would I check if I have anything supplying a different endpoint? - lisa.berry
I removed the credential and config file on the Windows machine that I am testing this on (same issues are happening on the Linux machine), and received the statement Unable to locate credentials. You can configure credentials by running "aws configure". After running the aws configure, and using copy/paste, I get the same error that I was previously "An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation: The AWS Access Key ID you provided does not exist in our records." I have followed the set up directions from AWS exactly, and do not understand why this happens. - lisa.berry

1 Answers

1
votes

Follow the Configuring the AWS CLI

You need to configure the aws credential on cli so that it can use those to talk to aws services. Make sure you have the same access keys present in the aws account and are active.