1
我已經在我的cloudformation模板中定義一個定製的授權:參考的API中的授權人定義網關路徑
MyCustomAuthorizer:
Type: AWS::ApiGateway::Authorizer
Properties:
Name: "MyCustomAuthorizer"
Type: "TOKEN"
AuthorizerUri: "arn:my_lambda"
IdentitySource: "method.request.header.Auth"
RestApiId:
Ref: ApiGatewayApi
而且我有一個API網關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: []
如何使具體是/echo
路徑使用MyCustomAuthorizer
?
我可以使用說明here