Creating a Authorizer for API:GatewayV2 (HTTP api) with a custom lambda authorizer using CFT

0

I have created HTTPapi and have integrated with the application load balancer, all this is working using CFT.

Now I wanted to add the authorizer to the API endpoint, I am able to implement it through console. But I am not able to figure out by CFT.

Documentation of Authorizer: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-authorizer.html CFT for reference, currently I am receiving error as "Invalid Authorizer URI: I have given the arn of lambda function.

{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "The template for API authorization.",
    "Parameters": {
        "projectName": {
            "Type": "String",
            "Default": "test"
        },
        "apiId": {
            "Type": "String"
        },
        "lambdaAuthArn": {
            "Type": "String"
        }
    },
    "Resources": {
        "authorizer": {
            "Type": "AWS::ApiGatewayV2::Authorizer",
            "Properties": {
                "ApiId": {
                    "Ref": "apiId"
                },
                "AuthorizerUri": {
                    "Ref": "lambdaAuthArn"
                },
                "AuthorizerType": "REQUEST",
                "Name": {
                    "Fn::Sub": "${projectName}-auth"
                  }
            }
        }
    },
    "Outputs": {
        "authorizerId": {
            "Description": "The Authorizer's ID.",
            "Value": {
                "Ref": "authorizer"
            }
        }
    }
}
  • Can you give an example of the AuthorizerUri you're using?

asked 5 months ago151 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions