Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aws::Errors::MissingCredentialsError:unable to sign request without credentials set

I am building a rails application and I am using dynamoDB as the database (using dynamoid). While I am running the tests, I get the following error:

Aws::Errors::MissingCredentialsError:unable to sign request without credentials set

Since tests are run in the local dynamoDB, I am a little confused over this error message. Is it that my tests are not running in local db and they are trying to access the remote db?

like image 230
Prakadeessh Arunachalam Avatar asked Aug 31 '25 22:08

Prakadeessh Arunachalam


1 Answers

You can use the below configuration for local dynamodb. When you give the localhost endpoint, the dynamodb uses the endpoint directly rather than deriving the endpoint from region.

Aws.config.update({
  region: 'us-west-2',
  credentials: Aws::Credentials.new('akid', 'secret'),
  endpoint:'http://localhost:8000'
})

The region is used to construct an SSL endpoint. If you need to connect to a non-standard endpoint, you may specify the :endpoint option.

like image 61
notionquest Avatar answered Sep 03 '25 13:09

notionquest