This straightforward aws.js script is used to execute dynamoDB operations locally.
"use strict";
const AWS = require("aws-sdk");
AWS.config.dynamodb = {
region: "eu-west-2",
endpoint: "http://localhost:8000"
};
module.exports = ()=>{
return new AWS.DynamoDB.DocumentClient();
};
How can I ensure that this code only runs locally? I want to prevent it from running in the actual lambda after my PR is merged. It should use the real dynamoDB instance in production.