rrahul963 / serverless-create-global-dynamodb-table

serverless plugin that would create global dynamodb tables for specified tables
Apache License 2.0
25 stars 17 forks source link

How can I customize stack name? #20

Closed zhaoyi0113 closed 4 years ago

zhaoyi0113 commented 4 years ago

First, thanks for releasing this awesome library. I have a feature request for stack name used in https://github.com/rrahul963/serverless-create-global-dynamodb-table/blob/40ad7ba07516d0cc96a39f62f36afb1a9310595e/src/helper.js#L356.

In my serverless.yml file, I am not using the stack name as serviceName-stageName. Below is my configuration:

provider:
  name: aws
  runtime: nodejs12.x
  region: ${opt:region}
  stackName: ${opt:stage}-${self:service.name}

If I use above configuration, I will get an error Failed to setup global table. Error Stack with id dbs-api-dev does not exist. dev is my stage name. I think this is because the code doesn't read stack name from my serverless. Can you make it read from serverless configuration?

rrahul963 commented 4 years ago

@zhaoyi0113 - thanks for pointing this out. i have updated and published the new version of code that uses provided stack name by default. Please use version 3.0.0 of the plugin.