-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from OasisDEX/kk/fix-sqs
FEAT - AWS SQS implementation
- Loading branch information
Showing
5 changed files
with
509 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as AWS from 'aws-sdk'; | ||
|
||
function getAWS() { | ||
if (process.env.AWS_SQS == 'production') { | ||
AWS.config.update({ | ||
accessKeyId: process.env.AWS_ACCESS_KEY_ID, | ||
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, | ||
region: process.env.AWS_REGION, | ||
}); | ||
return new AWS.SQS({ apiVersion: '2012-11-05' }); | ||
} else { | ||
const aws = { | ||
sendMessage: ( | ||
params: AWS.SQS.SendMessageRequest, | ||
callback?: ((err: AWS.AWSError, data: AWS.SQS.SendMessageResult) => void) | undefined, | ||
) => { | ||
console.log('Queue message body ', params); | ||
}, | ||
}; | ||
return aws; | ||
} | ||
} | ||
const aws = getAWS(); | ||
export { aws }; |
Oops, something went wrong.