How to create Cognito IdentityPool with Cognito UserPool as one of the Authentication provider using aws cdk?

前端 未结 3 999
猫巷女王i
猫巷女王i 2021-02-15 17:39

I am trying to create a Cognito FederatedIdentityPool with CognitoUserPool as one Authentication Provider. Creating UserPool was easy enough:



        
3条回答
  •  一整个雨季
    2021-02-15 18:15

    I was able to figure our how to attach UserPool to Identity Pool

        const userPool = new cognito.CfnUserPool(this, 'MyCognitoUserPool')
        const userPoolClient = new cognito.CfnUserPoolClient(this, 'MyCognitoUserPoolClient', {
          generateSecret: false,
          userPoolId: userPool.userPoolId
        });
    
        const identityPool = new cognito.CfnIdentityPool(this, 'MyCognitoIdentityPool', {
          allowUnauthenticatedIdentities: false,
          cognitoIdentityProviders: [{
            clientId: userPoolClient.userPoolClientId,
            providerName: userPool.userPoolProviderName
          }]
        });
    

    Still struggling with attaching Role to IdentityPool and don't know the difference between CfnUserPool and UserPool. However, this question can marked as partially resolved.

提交回复
热议问题