Skip to content

Conversation

@roni-frantchi
Copy link
Contributor

Adding the ability to export a function (potentially async) to resolve the configuration.
We found it particularly useful when resolving DynamoDB setup from the Serverless Framework, so one does not have to repeat ones own Dynamo table setup in code.
Could of course support other use cases as well.

module.exports = async () => {
  await serverless.init();
  const service = await serverless.variables.populateService();
  const tables = service.resources.Resources.filter(r => r.Type === 'AWS::DynamoDB::Table').map(
    r => r.Properties
  );

  return {
    tables,
    port: 8000
  };
};

Copy link
Member

@vladholubiev vladholubiev left a comment

Choose a reason for hiding this comment

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

👍 Awesome! Thanks for the contribution!

@vladholubiev vladholubiev merged commit 05dcb30 into shelfio:master Jun 25, 2019
@vladholubiev
Copy link
Member

@roni-frantchi I've just published v1.2.0 🎉

@roni-frantchi
Copy link
Contributor Author

Jest saw that - 🚀 Thanks @vladgolubev !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants