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

Logical names are not resolved inside notifications definition #582

Open
psvaiter opened this issue Aug 24, 2023 · 0 comments
Open

Logical names are not resolved inside notifications definition #582

psvaiter opened this issue Aug 24, 2023 · 0 comments

Comments

@psvaiter
Copy link

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

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

No branches or pull requests

1 participant