Skip to content

Lambda invokes fail when Logical Ids are invalid (non-alphanumeric) #686

Closed

Description

@nav-agarwal

Description:
I have sam_template file with function name as Cloud_Views. This throws
"error while running samlocal
local start_lambda command is called"
Error:

Steps to reproduce the issue:

  1. Create Sam_template file with one of the funciton name having underscore in it.
  2. Run sam local. sam local start-lambda

Observed result:
"
2018-10-01 11:43:23 local start_lambda command is called
Error:
"
Expected result:
No error should be seen

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Linux samlocal 4.4.0-127-generic #153-Ubuntu
Output of sam --version:
SAM CLI, version 0.6.0

Activity

  1. jfuss commented on Oct 1, 2018

    @jfuss
    Contributor

    @nav-agarwal Logical Ids are defined to be alphanumeric (A-Za-z0-9). You will need to update the logical Ids in your template to be valid. We should have further validation locally to force this and ensure errors like this do not occur.

    Updating the title and marking as a bug.

  2. added
    area/validate
    on Oct 1, 2018
  3. changed the title [-]SamTemplate: Function Names can't have underscore[/-] [+]Lambda invokes fail when Logical Ids are invalid (non-alphanumeric)[/+] on Oct 1, 2018
  4. jfuss commented on Dec 27, 2018

    @jfuss
    Contributor

    @keetonian Do you think this is something SAM Translator should do? That is validate the LogicalIds of SAM resources (maybe all resources)? CFN-Lint might do this as well, so maybe it worth just using that for the validation instead.

    Would love to hear your thoughts.

  5. andremrezende commented on Jan 7, 2020

    @andremrezende

    Hi guys.
    Possible it was forgotten.
    Let me know any progress, thanks.

  6. keyboardDrummer commented on Jan 14, 2020

    @keyboardDrummer

    @jfuss Could you explain why the SAM CLI only allows AlphaNumeric characters in Lambda function identifiers?

  7. jfuss commented on Jan 14, 2020

    @jfuss
    Contributor

    @keyboardDrummer Please see my above comment: #686 (comment)

  8. jfuss commented on Feb 11, 2020

    @jfuss
    Contributor

    The empty error reported was due to some Pythong2.7 support issues we had but currently do not support Python2.7 anymore.

    Closing as we report this correctly to the console now.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/validatetype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions