I've defined a custom authorizer in my cloudformation template:
MyCustomAuthorizer:
Type: AWS::ApiGateway::Authorizer
Properties:
Name: "MyCustomAuthorizer"
Type: "TOKEN"
AuthorizerUri: "arn:my_lambda"
IdentitySource: "method.request.header.Auth"
RestApiId:
Ref: ApiGatewayApi
And I have a Api Gateway API:
ApiGatewayApi:
Type: AWS::ApiGateway::RestApi
Properties:
Name: "ApiGatewayApi"
Description: "Api gateway REST API"
Body:
basePath: "/prod"
schemes:
- "https"
paths:
/echo:
get:
consumes:
- "application/json"
produces:
- "application/json"
responses:
"200":
description: "200 response"
schema:
$ref: "#/definitions/schema"
security:
- sigv4: []
How do I make specifically the /echo
path use MyCustomAuthorizer
?
I can do this on the console using the instructions here