question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logical ID naming is not following the convention with `-` or `_`

See original GitHub issue

This is a Bug Report

Logical ID naming is not following the convention if lambda function name contains - or _.

Description

With this settings:

service: dash

provider:
  name: aws
  runtime: nodejs6.10

functions:
  photo-resize:
    handler: handler.hello
  photo_recolor:
    handler: handler.hi

sls package produced cloudformation-template-update-stack.json including folloings:

  • PhotoDashresizeLambdaFunction
  • PhotoDashresizeLambdaVersionPSzzisjnTvvYknuXwQOlAvdkQZ67qXYSvgoAi9T8W0
  • PhotoDashresizeLambdaFunctionQualifiedArn
  • PhotoUnderscorerecolorLambdaFunction
  • PhotoUnderscorerecolorLambdaVersionPSzzisjnTvvYknuXwQOlAvdkQZ67qXYSvgoAi9T8W0
  • PhotoUnderscorerecolorLambdaFunctionQualifiedArn

Expected is like:

  • PhotoDashResizeLambdaFunction
  • PhotoUnderscoreRecolorLambdaFunction

as the document says:

https://github.com/serverless/serverless/blob/master/docs/providers/aws/guide/resources.md#override-aws-cloudformation-resource

This cause trouble when trying to hook S3 event, because we need to overwrite some auto generated resource.

https://github.com/serverless/serverless/blob/master/docs/providers/aws/events/s3.md#custom-bucket-configuration

Related to:

Additional Data

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           6.10.3
     Serverless Version:     1.23.0

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhidecommented, Nov 16, 2017

Hi @HyperBrain, thank you for your quick reply.

Yeah, I understand the situation. I am fine with leaving it as it is, and updating the document.

Just I hope the naming itself is fixed some day 😉

0reactions
horike37commented, Jan 11, 2018

It may add this to v2 milestone if we would change the convention.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resources - AWS CloudFormation
The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. Use the logical name to reference the resource in other parts...
Read more >
Define your naming convention - Cloud Adoption Framework
When you construct your naming convention, identify the key pieces of information you want to reflect in a resource name. Different information ...
Read more >
Follow parameter naming standards | AWS Partner Solutions
Naming parameters. For parameter names (logical IDs), follow these guidelines: Use Pascal case and begin with an uppercase letter.
Read more >
Naming conventions - Terraform Best Practices
There should be no reason to not follow at least these conventions :) Beware that actual cloud resources often have restrictions in allowed...
Read more >
Learn SQL: Naming Conventions - SQLShack
Also, using the naming convention is not the rule, but it's desired. While most rules are pretty logical, you could go with some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found