-
Notifications
You must be signed in to change notification settings - Fork 35
varibales in tables names in serverless.yml #17
Comments
@SET001 -- You're correct. At the moment we do not support variables. This should not take long to implement and will put it on my task queue. In the meantime, you are welcome to put up a PR. |
@cbaron I have some free time on this weekends so I difinelty can try to prepare some PR. Can you give me a short help on where to begin with and how you see realisation? |
from what I see in code, here we have loadServerlessConfig that can be used to load and parse yml file and seems like it resolves variables correctly. Can it be used in server.js:createSchema? |
@SET001 I added a test case and fixed it for this particular issue. This should be fixed in 0.7.3 |
than you, it is fixed now ) |
I thisnk following also related to this issue. The problem is that you can't use
result it such an error:
|
@SET001 This one is harder I don't think we can support cloud formation template syntax at this time. Can you assign the name to a serverless variable and use it in both places? |
If needed pleas open a new issue to discuss supporting cloud formation syntax. I don't think we can support it at this time but if it's a serious blocker we can see what we can do. |
It seems like currenlty emulator does not revognize variables in table names in serverless.yml file.
having such a declaration in yml:
TableName: ens-webhooks-${self:provider.stage}
I'm getting error this error when starting emulator:
{ ValidationException: Invalid table/index name. Table/index names must be between 3 and 255 characters long, and may contain only the characters a-z, A-Z, 0-9, '_', '-', and '.'
it's sad that the error message does not contain actual table name which occures error.
After digging a bit I found that error comes from asw-sdk and the params passed there contain, among all others, such thing:
params: { TableName: 'ens-webhooks-${self:provider.stage}',
am I doing something wrong or emulator indeed does not support variables in yml?
The text was updated successfully, but these errors were encountered: