diff --git a/src/helpers/_dynamo.js b/src/helpers/_dynamo.js index 4c78d50..2c4dffe 100644 --- a/src/helpers/_dynamo.js +++ b/src/helpers/_dynamo.js @@ -37,10 +37,10 @@ module.exports = function getDynamo (callback) { port, region: AWS_REGION || 'us-west-2' }, - function gotClient (err, { dynamodb }) { + function gotClient (err, client) { if (err) callback(err) else { - db = dynamodb + db = client.dynamodb callback(null, db) } }) diff --git a/src/helpers/_get-ports.js b/src/helpers/_get-ports.js index 62cf679..930a1e4 100644 --- a/src/helpers/_get-ports.js +++ b/src/helpers/_get-ports.js @@ -39,9 +39,10 @@ module.exports = function getPorts (callback) { region: AWS_REGION || 'us-west-2', } - aws(config, function gotClient (err, { ssm }) { + aws(config, function gotClient (err, client) { if (err) callback(err) else { + let { ssm } = client let getParameter = util.callbackify(ssm.GetParameter) getParameter({ Name }, function done (err, result) { if (err) callback(err) diff --git a/src/helpers/_get-table-name.js b/src/helpers/_get-table-name.js index ca057a3..001f6ba 100644 --- a/src/helpers/_get-table-name.js +++ b/src/helpers/_get-table-name.js @@ -45,9 +45,10 @@ module.exports = function getTableName (callback) { } function go (config) { - aws(config, function gotClient (err, { ssm }) { + aws(config, function gotClient (err, client) { if (err) callback(err) else { + let { ssm } = client let getParameter = util.callbackify(ssm.GetParameter) getParameter({ Name }, function done (err, result) { // let ssm = new SSM(config) diff --git a/test/integration-test.js b/test/integration-test.js index de41544..a3141fe 100644 --- a/test/integration-test.js +++ b/test/integration-test.js @@ -14,6 +14,8 @@ test('env', t => { test('Start sandbox', async t => { t.plan(1) + process.env.AWS_ACCESS_KEY_ID = 'arc_dummy_access_key', + process.env.AWS_SECRET_ACCESS_KEY = 'arc_dummy_secret_key', await sandbox.start({ cwd: __dirname, quiet: true }) t.pass('started') }) @@ -254,6 +256,8 @@ test('paginate ten at a time', async t => { // fin test('shutdown sandbox', async t => { t.plan(1) + delete process.env.AWS_ACCESS_KEY_ID + delete process.env.AWS_SECRET_ACCESS_KEY await sandbox.end() t.pass('done') }) diff --git a/test/namespace-test.js b/test/namespace-test.js index ae05580..95e32bb 100644 --- a/test/namespace-test.js +++ b/test/namespace-test.js @@ -4,6 +4,8 @@ let test = require('tape') test('start sandbox', async t => { t.plan(1) + process.env.AWS_ACCESS_KEY_ID = 'arc_dummy_access_key', + process.env.AWS_SECRET_ACCESS_KEY = 'arc_dummy_secret_key', await sandbox.start({ quiet: true, cwd: __dirname }) t.pass('sandbox.start') }) @@ -28,6 +30,8 @@ test('tables with similar namespacing', async t => { test('shutdown sandbox', async t => { t.plan(1) + delete process.env.AWS_ACCESS_KEY_ID + delete process.env.AWS_SECRET_ACCESS_KEY await sandbox.end() t.pass('sandbox.end') })