Created
March 10, 2020 14:02
-
-
Save mtimbs/30a1bd9170f98cc38b97e86d48a731b5 to your computer and use it in GitHub Desktop.
example DynamoDB Client base module if not using powertools library
This file contains hidden or 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
import { ClientConfiguration, DocumentClient } from 'aws-sdk/clients/dynamodb'; | |
const config: ClientConfiguration = { | |
region: process.env.AWS_REGION, | |
accessKeyId: process.env.AWS_ACCESS_KEY, | |
secretAccessKey: process.env.AWS_SECRET_KEY, | |
}; | |
if (['test'].includes(process.env.NODE_ENV)) { | |
config.endpoint = 'http://localhost:8000'; | |
config.sslEnabled = false; | |
} | |
export default new DocumentClient(config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment