Serverless-application-model: AWS::Serverless::HttpApi - Unable to setup Lambda Authorizer

Created on 14 Oct 2020  路  5Comments  路  Source: aws/serverless-application-model

Description:

When trying to use AWS::Serverless:HttpApi through a SAM template. There appears to be no way to specify a Lambda Authorizer against reference link 1. It only appears possible to use OAuth2Authorizer.

Should be able to configure lambda authorizer as per reference link 2 via SAM template.

Expected result:
Be able to setup a lambda authorizer against a AWS::Serverless:HttpApi

Reference Links:

  1. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-httpapi-httpapiauth.html
  2. https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html

Most helpful comment

@darkpanic I'm not looking to use AWS:Serverless:Api. I know I could use it, but there's reasons where I need to use AWS::Serverless:HttpApi.

The HTTP API Gateway does supports lambda authorizers as per reference link 2 on my post. They are just not configurable from within a SAM template as it currently stands, but they should be.

All 5 comments

Hi! You are correct that the HTTP API has less functionality and you likely want to look at AWS::Serverless::Api, configuring the Authorizer property within Auth to reference the LambdaRequestAuthorizer.

Hope this helps!

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-api-lambdarequestauthorizer.html

@darkpanic I'm not looking to use AWS:Serverless:Api. I know I could use it, but there's reasons where I need to use AWS::Serverless:HttpApi.

The HTTP API Gateway does supports lambda authorizers as per reference link 2 on my post. They are just not configurable from within a SAM template as it currently stands, but they should be.

I would also like to add that SAM does not support IAM Authorizors for Http Api. If these could be added too that would be really helpful.

We will release #1733 to support it.

We have released #1733 . SAM will support Lambda Authorizer since version 1.28.1. Will close this one.

Was this page helpful?
0 / 5 - 0 ratings