New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aws::Errors::MissingCredentialsError #1951
Comments
Have you referred to the Configuring the AWS SDK for Ruby documentation page? This is the suggested way to read from a specific path (using the SharedCredentials format):
If you need to read from JSON, you need to perform an update on Aws.config:
|
Hi Thanks |
Im, getting the same error: `shared_creds = Aws::SharedCredentials.new(profile_name: 'default', path: '/etc/sensu/plugins/credentials') {:credentials=>#<Aws::SharedCredentials profile_name="default" path="/etc/sensu/plugins/credentials">} What I do not understand is why if I use this way does not work either, the only way to make it works if exporting the variables from bash. Aws.config.update({ Any idea? |
I noticed that it works from the standard path, /root/.aws/credentials. |
Are the formats of I would also check that you have the proper permissions for that path. If you need additional help, Stack Overflow would be a good place using the aws-sdk-ruby tag. |
Yes, I just created .aws under root and copied the credentials file, so, the format is fine, and the permission on the alternate location are fine as well, the process is executed by sensu, so, root should be able to read it as well, and checked the execution permissions as well. So by now, It's working like that, using /root/.aws/credentials which seems to be default. Thanks |
Hard coding credentials is not recommended. This does work if needed:
|
Closing this issue. Let us know if there's a need to re-open. |
Hi, I am facing a similar issue. I did upgraded my gems but still i got the same error "Loading ENV vars from AWS secrets manager" Any suggestions how to fix it ? |
Hello,
I've been hitting my head against the wall for a while, I cannot authenticate using aws.config
I have the following.
Json file.
{
"AccessKeyId": "XXXXXXX",
"SecretAccessKey": "XXXXXXXXX"
}
require 'aws-sdk'
requite 'json'
sns = Aws::SNS::Resource.new(region: 'us-east-1')
topic = sns.topic('arn:aws:sns:us-east-1:xxxxxxxxxxx:Sensu-SMS')
creds = JSON.load(File.read('secrets.json'))
Aws.config[:credentials] = Aws::Credentials.new(creds['AccessKeyId'], creds['SecretAccessKey'])
puts Aws.config.inspect
topic.publish({
message: 'Hello From Sensu!'
})
Output from put, I do not see secretkey
{:credentials=>#<Aws::Credentials access_key_id="XXXXXXX">}
ruby 2.0.0p648 (2015-12-16) [x86_64-linux
aws-sdk (3.0.1)
I get the following error and the same happend if I embed the credential on the script itself like.
Aws.config.update({
credentials: Aws::Credentials.new('your_access_key_id', 'your_secret_access_key')
})
/usr/local/share/gems/gems/aws-sdk-core-3.44.1/lib/aws-sdk-core/plugins/signature_v4.rb:72:in `sign_request': unable to sign request without credentials set (Aws::Errors::MissingCredentialsError
I do not know if this is a bug or what else.
Any help appreciated.
Thanks
Regards
The text was updated successfully, but these errors were encountered: