Solution found. Step 3 was where I had problems.
TL; DR
I did not understand that module.exports.thing makes the thing object accessible through sails.config.thing . Good to know.
1) I created a new file in config / aws.js with the contents
// Get heroku config values module.exports.aws = { key: process.env.AWS_KEY, secret: process.env.AWS_SECRET }
2) . Actual AWS credits are placed in local.js (this will not be in the repository, since sails automatically ignore local.js using gitignore).
aws: { key: actual-key, secret: actual-secret }
This allows local testing when we do not have access to the hero configuration settings, while protecting these values ββfrom exposure in the github registry.
3) Now, to access the controller:
var aws_config = sails.config.aws; AWS.config.update({ accessKeyId: aws_config.key, secretAccessKey: aws_config.secret });
Drew
source share