0
respostas

Erro ao executar o comando node send-message.js

Quando tento executar o comando node send-message.js, aparece o erro: UnhandledPromiseRejectionWarning: AccessDenied: Access to the resource https://sqs.us-east-1.amazonaws.com/ is denied.

As credenciais da aws já estão setadas em variáveis de ambiente e consigo enviar e receber mensagens via CLI.

Alguém sabe como resolver? Aqui está toda a stack do erro:

(node:96465) UnhandledPromiseRejectionWarning: AccessDenied: Access to the resource https://sqs.us-east-1.amazonaws.com/ is denied. at Request.extractError (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/protocol/query.js:50:29) at Request.callListeners (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/sequential_executor.js:106:20) at Request.emit (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/sequential_executor.js:78:10) at Request.emit (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/request.js:688:14) at Request.transition (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/state_machine.js:14:12) at /Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/request.js:38:9) at Request. (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/request.js:690:12) at Request.callListeners (/Users/macbookair/Downloads/sqs-1914-master/node_modules/aws-sdk/lib/sequential_executor.js:116:18) (node:96465) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:96465) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.