Skip to content

Logical names are not resolved inside notifications definition #582

Open
@psvaiter

Description

@psvaiter

This is a Bug Report

What went wrong?

I could not reference a Lambda ARN inside the notifications using the logical name declared in serverless.yml.

What did you expect should have happened?

The plugin should be able to normalize the function name as it does for Resource or role inside the state machine when Ref or Fn::GetAtt are used.

What was the config you used?

functions:
  send-email-on-failure:
    handler: path/to/file.handler

stepFunctions:
  stateMachines:
    workflow:
      name: ${self:service}
      role:
        Fn::GetAtt: ["StateMachineRole", "Arn"]
      notifications:
        FAILED:
          - lambda:
              Fn::GetAtt: [send-email-on-failure, Arn]

      ... more state machine definition code here

If I replace the function call inside the FAILED status by Fn::GetAtt: [SendDashemailDashonDashfailureLambdaFunction, Arn] everything works. That was tough to discover. 😅

What stacktrace or error message from your provider did you see?

UPDATE_FAILED: MyDashserviceDashworkflowNotificationsFAILEDEventRule (AWS::Events::Rule)
Parameter my-service-dev-send-email-on-failure is not valid. Reason: Provided Arn is not in correct format. (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: <id>; Proxy: null)

Similar or dependent issues

None

Additional Data

  • Serverless Framework Core Version you're using: 3.34.0
  • The Plugin Version you're using: 3.14.0
  • Operating System: Ubuntu

I searched the codebase and could find only 3 references to what it seems the function that converts the logical name into the normalized name. I would expect there's a call to it inside the "compileNotifications.js" too.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions