How to use the middy/middlewares.secretsManager function in middy

To help you get started, we’ve selected a few middy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github theburningmonk / manning-aws-lambda-in-motion / functions / get-index.js View on Github external
};

  callback(null, response);
});

module.exports.handler = wrapper(handler)
  .use(ssm({
    cache: true,
    cacheExpiryInMillis: 3 * 60 * 1000, // 3 mins
    setToContext: true,
    names: {
      restaurants_api: `/bigmouth/${STAGE}/restaurants_api`,
      orders_api: `/bigmouth/${STAGE}/orders_api`
    }
  }))
  .use(secretsManager({
    cache: true,
    cacheExpiryInMillis: 3 * 60 * 1000, // 3 mins
    secrets: {
      cognito: `/bigmouth/${STAGE}/cognito`
    }
  }));