Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CloudFormation template is invalid: Template format error: Resource name DynamoDBAutoscaleRoletable_with_underscore is non alphanumeric. #4

Closed
charleswhchan opened this issue Jul 20, 2017 · 3 comments · Fixed by #6
Assignees
Labels

Comments

@charleswhchan
Copy link
Contributor

Tried using the plugin but ran into the following error:

The CloudFormation template is invalid: Template format error: Resource name DynamoDBAutoscaleRolemy_table_dev is non alphanumeric.

This is my serverless.yml file:

plugins:
  - serverless-dynamodb-autoscaling

custom:
  capacities:
    - name: my_table_dev
      read:
        minimum: 1
        maximum: 100
        usage: 0.70
      write:
        minimum: 1
        maximum: 100
        usage: 0.70

If I add the autoscaling via the AWS Console, it will default to creating a "DynamoDBAutoScaleRole" or use an existing role:
image

Perhaps the easiest solution is to strip the underscore from the table name (if any) to create a valid resource name? What do you think?

@sbstjn
Copy link
Owner

sbstjn commented Jul 20, 2017

Thanks for reporting this. I'm using input.replace(/\W/g, '') in names.js and W only matches for - and not for _. There should be more verbose tests to handle specials characters as well …

@sbstjn
Copy link
Owner

sbstjn commented Jul 20, 2017

Deployment for v0.1.2 just started. This should include a fix of the regular expression to replace _ as well.

@sbstjn sbstjn removed the active label Jul 20, 2017
@sbstjn sbstjn self-assigned this Jul 20, 2017
@charleswhchan
Copy link
Contributor Author

Thanks @sbstjn. That was quick 😄 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants