serverless-operations / serverless-step-functions

AWS Step Functions plugin for Serverless Framework ⚡️
Other
1.03k stars 206 forks source link

Custom Authorizer Error #377

Open db46 opened 4 years ago

db46 commented 4 years ago

This is a Bug Report

Description

For bug reports: I have added a custom authorizer as per the plugins instructions, however it repeatedly fails. I have tried many different combinations, including the exact arn for the authorizer lambda.

Using an IAM as an authorizer works - but this was only to validate that an authorizer could be added.

Here is an extract of my serverless.yml

custom:
  pythonRequirements:
    dockerizePip: non-linux
  authorizer: arn:aws:lambda:#{AWS::Region}:#{AWS::AccountId}:function:auth-service-${self:provider.stage}-auth

functions:
  stepTest:
    handler: stepTest.lambda_handler
    package: {}

stepFunctions:
  stateMachines:
    hellostepfunc1:
      events:
        - http:
            path: onboard
            method: post
            authorizer: ${self:custom.authorizer}
            cors: true
            request:
              template: lambda_proxy
      name: OnBoardingStateMachine
      definition:
        Comment: "Step function to manage the onboarding service"
        StartAt: HelloWorld1
        States:
          HelloWorld1:
            Type: Task
            Resource: arn:aws:lambda:#{AWS::Region}:#{AWS::AccountId}:function:${self:service}-${self:provider.stage}-stepTest
            InputPath: $
            Parameters:
              input.$: $
              step: HelloWorld1
            End: true
resources:
  Outputs:
    MyStateMachine:
      Description: The ARN of the example state machine
      Value:
        Ref: OnBoardingStateMachine

I get the following output:

  Type Error ---------------------------------------------

  TypeError: Cannot read property 'Fn::GetAtt' of undefined
      at getFunctionLogicalId 

Similar or dependent issues:

Additional Data

vladholubiev commented 3 years ago

Facing the same issue as the OP. @db46 have you found a solution to this?

ereber commented 3 years ago

I am also having this problem @db46 . Is there a solution or a workaround?