Skip to content

Instantly share code, notes, and snippets.

@mtimbs
Created March 10, 2020 14:02
Show Gist options
  • Save mtimbs/30a1bd9170f98cc38b97e86d48a731b5 to your computer and use it in GitHub Desktop.
Save mtimbs/30a1bd9170f98cc38b97e86d48a731b5 to your computer and use it in GitHub Desktop.
example DynamoDB Client base module if not using powertools library
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