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?

질문됨 5달 전158회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠