AWS SAMでCognito User Pools Authorizerを使用してAPIを作成するにはどうすればよいですか?AWS SAM API with Cognito User Pools Authorizer
Theres AWS::ApiGateway::Authorizer。しかし...それはRestApiIdのように見える
{
"Type" : "AWS::ApiGateway::Authorizer",
"Properties" : {
"AuthorizerCredentials" : String,
"AuthorizerResultTtlInSeconds" : Integer,
"AuthorizerUri" : String,
"IdentitySource" : String,
"IdentityValidationExpression" : String,
"Name" : String,
"ProviderARNs" : [ String, ... ],
"RestApiId" : String,
"Type" : String
}
}
この承認者を使用するAPIを指し? AWS SAMでは、私のAPIは次のように定義されています
Resources:
Ec2Index:
Type: AWS::Serverless::Function
Properties:
Handler: ec2/index.handler
Runtime: nodejs6.10
CodeUri: ./src
FunctionName: 'ApiEc2IndexHandler'
Description: 'List EC2 resources'
Timeout: 30
Role: 'arn:aws:iam::598545985414:role/awsmanagement-lambda-management'
Events:
Ec2Index:
Type: Api
Properties:
Path: /ec2
Method: get
私はそれらをどのように関連付けるのですか?