title: IdentityPool Creation with CloudFormation
body: <p>I'm attempting to follow along with a tutorial located at <a href="http://serverless-stack.com/chapters/create-a-cognito-identity-pool.html" rel="noreferrer">http://serverless-stack.com/chapters/create-a-cognito-identity-pool.html</a> for identity pool creation and document the creation by using cloudformation so that I can easily undo everything when I am done. However, I am having trouble finding any examples that show how to effectively do this using the template syntax. What I currently have is the following </p>
  
  <pre><code>ScratchUserPool:
        Type: AWS::Cognito::UserPool
        Properties:
          UserPoolName: notes-user-pool
  
  ScratchUserPoolClient:
    Type: AWS::Cognito::UserPoolClient
    Properties:
      ClientName: notes-client
      ExplicitAuthFlows: [ADMIN_NO_SRP_AUTH]
      UserPoolId:
        Ref: ScratchUserPool
  
  ScratchIdentityPool:
    Type: AWS::Cognito::IdentityPool
    Properties:
      IdentityPoolName: ScratchIdentityPool
      AllowUnauthenticatedIdentities: false
      CognitoIdentityProviders:
        - ClientId:
            Ref: ScratchUserPoolClient
          ProviderName:
            Ref: ScratchUserPool
  </code></pre>
  
  <p>The deployment step is failing when it attempts to create the <code>ScratchIdentityPool</code>. I get an error stating that: </p>
  
  <blockquote>
    <p>An error occurred while provisioning your stack: ScratchIdentityPool -
    Invalid Cognito Identity Provider (Service: AmazonCognitoIdentity;
    Status Code: 400; Error Code: InvalidParameterException; Request ID:
    bc058020-663b-11e7-9f2a-XXXXXXXXXX)</p>
  </blockquote>
  
  <p>Am I not referencing the Client or Provider name correctly? </p>