Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

--dynamodb-port CLI arg works again #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ScottAP108
Copy link

  • version 0.14 of the emulator broke the use of a fixed dynamoDB port specified via CLI as --dynamodb-port. I have fixed this by restoring a missing function parameter for the port and using that when there is no custom config file.

@@ -5,6 +5,7 @@ const { DynamoDB } = require('aws-sdk');
async function deriveDynamoDBClient(
{ DynamoDB: config },
emulatorPath = process.cwd(),
port,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only specifying two parameters when it was actually receiving three arguments from bin/server. That third argument is the dynamodb port specified via CLI.

@@ -19,7 +20,6 @@ async function deriveDynamoDBClient(
// start the dynamodb emulator
const dynamoEmulator = require('@conduitvc/dynamodb-emulator');
const dbPath = path.join(path.dirname(emulatorPath), '.dynamodb');
const { port } = config;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the function should not be using the config. This is for a default config, which is hardcoded in config.js as

module.exports = {
  DynamoDB: {
    emulator: true,
  },
};

So there is no port here, which means port will always be undefined. Instead, this line should be eliminated, and the port value passed in from the CLI should be used to launch the emulator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant