1

Cognito 사용자 풀을 성공적으로 배포하고이를 API 게이트웨이에서 API에 프록시하도록 설정 한 방법에 대해 인증에 사용했습니다. 이제 Cloudform을 생성합니다. 같은 스택의 템플릿. CloudForm을 사용하여 API Gateway와 사용자 풀을 사용하는 Authorizer를 설정합니다. 잘 작동합니다. 내가 작성한 인증을 사용하는 방법을 배포 할 때, 그것은 말하는 실패 :Cognito 사용자 풀 AuthorizerId를 API 게이트웨이 클라우드 정보에 설정할 수 없습니다.

TestMethod: 
    Type: AWS::ApiGateway::Method 
    Properties: 
    RestApiId: !Ref RestApi 
    ResourceId: !Ref TestResource 
    HttpMethod: POST  
    AuthorizationType: COGNITO_USER_POOLS 
    AuthorizerId: !Ref ApiAuthorizer 
    Integration: 
     Type: HTTP_PROXY 
     IntegrationHttpMethod: POST 
     Uri: https://api.example.com/test 

ApiAuthorizer: 
    Type: "AWS::ApiGateway::Authorizer" 
    Properties: 
    AuthorizerResultTtlInSeconds: 300 
    IdentitySource: method.request.header.Authorization 
    Name: CognitoDefaultUserPoolAuthorizer 
    ProviderARNs: 
     - !ImportValue DefaultUserPool::Arn 
    RestApiId: !Ref RestApi 
    Type: "COGNITO_USER_POOLS" 

인가 자 잘 배치하고 나는 그것의 ID를 볼 수 있습니다

Invalid authorizer ID specified. Setting the authorization type to CUSTOM 
or COGNITO_USER_POOLS requires a valid authorizer. 

이것은 Cloudformation 스택의 관련 부분입니다 Cloudform에서이 메소드는 권한 부여없이 잘 배포됩니다. Authorizer를 참조하는 대신 직접 ID를 지정하면 동일한 문제가 발생합니다.

구름 형성을위한 Authorizer docsRef!이 ID를 반환해야하므로 여기에서 무슨 일이 일어나고 있는지에 대해 당황 스럽습니다.

나에게 버그와 같지만 어쩌면 내가 누락 된 것일까 요?

답변

0

AWS에서이 문제를 해결했습니다. 그것은 원래 게시 된 예제에 따라 작동합니다.