Aws-cli: Unrecognized resource types: CognitoUserPool, CognitoUserPoolClient

Created on 28 Jun 2017  ·  3Comments  ·  Source: aws/aws-cli

I wanted to deploy my CF stack via Serverless framework, but I received exception. So I validated CF config via aws-cli and it respond with ValidationError.

Resources:
  CognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      UserPoolName: test-pool
  CognitoUserPoolClient:
    Type: AWS::Cognito::UserPoolClient
    Properties:
      ClientName: test-client
      ExplicitAuthFlows:
        - ADMIN_NO_SRP_AUTH
      GenerateSecret: false
      UserPoolId:
        Ref: CognitoUserPool
aws cloudformation validate-template --template-body file://test-template.yml



md5-0884b744ef7ebb7d442c0f51b32b4a9f



An error occurred (ValidationError) when calling the ValidateTemplate operation: Template format error: Unrecognized resource types: [AWS::Cognito::UserPool, AWS::Cognito::UserPoolClient]

It was strange because I was sure that CF configuration was correct and I was able to deploy it before on my old machine. I fought that it can be bug in the new 1.11.113 version, so I tried it on my old machine and it worked like a charm on 1.11.84. However, when I reinstalled 1.11.113 to older 1.11.84 the error message remained. Please, can you tell me what I am doing wrong?. Thank you.

closing-soon guidance service-api

Most helpful comment

Well I figured that out. I had configured AWS_DEFAULT_REGION=us-west-1 and Amazon does not support Cognito in that region. When I change it to lets say us-east-1 it works. This behavior is same in both versions, I just happened to have a different region in older machine. Thanks for helping me out!

All 3 comments

Interesting I cant replicate this. Your given template works fine for me under 1.11.113. Can you add --debug to your call and post the logs here, that may give more indication of what is going on.

In general the version of the CLI shouldn't be affecting this since that is a response we get from the service. all we do is send them your template and print out the response we get. Is there anything else at all that is varying between those two invocations other than the CLI version?

Well I figured that out. I had configured AWS_DEFAULT_REGION=us-west-1 and Amazon does not support Cognito in that region. When I change it to lets say us-east-1 it works. This behavior is same in both versions, I just happened to have a different region in older machine. Thanks for helping me out!

Awesome glad you figured it out!

Was this page helpful?
0 / 5 - 0 ratings