Im, having issues using aws-sdk, Im new to ruby and also need some debug assistance.
Im trying to send sms notifications over AWS sns topic/subscription, Im using example from AWS documentation
but have no luck authenticating from within ruby script.
creds = JSON.load(File.read(‘secrets.json’))
Aws.config[:credentials] = Aws::Credentials.new(creds[‘AccessKeyId’], creds[‘SecretAccessKey’])
message: ‘Hello From Sensu!’
This does not work either.
AWS.config(access_key_id: ‘XXXXX’, secret_access_key: ‘XXXXXX’, region: ‘us-east-1’)
The code above does not work, nor even if I hardcode the credential, with put I can see creds has the values,
do not know how to put AccessKeyId or SecretAccessKey, they seems to be empty ,Im always getting this error
/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)
The only way to make it work is if I export the variables from bash.
I found how to echo the variable and I can see it has this content, is it seems the secret key is missing.
Thanks in advance