serverless-step-functions icon indicating copy to clipboard operation
serverless-step-functions copied to clipboard

Custom Authorizer Error

Open db46 opened this issue 5 years ago • 2 comments

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:

  • #38

Additional Data

  • Serverless Framework Core Version you're using: 1.82.0
  • The Plugin Version you're using: 2.26
  • Operating System: MacOS

db46 avatar Sep 19 '20 21:09 db46

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

vladholubiev avatar Dec 23 '20 11:12 vladholubiev

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

ereber avatar Jun 07 '21 14:06 ereber