title: Getting InvalidIdentityPoolConfigurationException when Retriving records from AWS DynamoDB iOS
body: <p>I have used AWS DynamoDB in my app. i am using AWSDynamoDBObjectMapper for fetching records from database but getting InvalidIdentityPoolConfigurationException every time. i have set poolId and region in info.pilist,</p>
  
  <p><a href="https://i.stack.imgur.com/dhbpq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dhbpq.png" alt="enter image description here"></a></p>
  
  <p>Following is my code,</p>
  
  <p><strong>AppDelegate.m</strong></p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
  AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                  identityPoolId:IDENTITY_POOL_ID];
  
  
  
  AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast2
                                                                       credentialsProvider:credentialsProvider];
  
  AWSServiceManager.defaultServiceManager.defaultServiceConfiguration = configuration;
  
  AWSDynamoDBObjectMapperConfiguration *objectMapperConfiguration = [[AWSDynamoDBObjectMapperConfiguration alloc] init];
  [AWSDynamoDBObjectMapper registerDynamoDBObjectMapperWithConfiguration:configuration objectMapperConfiguration:objectMapperConfiguration forKey:@"USEast1DynamoDBObjectMapper"];
  _dynamoDBObjectMapper = [AWSDynamoDBObjectMapper DynamoDBObjectMapperForKey:@"USEast1DynamoDBObjectMapper"];
  return YES;
  }
  </code></pre>
  
  <p><strong>DynamoDBManager.m</strong></p>
  
  <pre><code>+(void)loginWithFaceBook:(NSString*)fbId{
  
  AWSDynamoDBScanExpression *scanExpression = [AWSDynamoDBScanExpression new];
  scanExpression.filterExpression = @"facebook_id = :val";
  scanExpression.expressionAttributeValues = @{@":val":fbId};
  
  [[AppContext.dynamoDBObjectMapper scan:[dynamo_user class]
                   expression:scanExpression]
   continueWithBlock:^id(AWSTask *task) {
       if (task.error) {
           NSLog(@"The request failed. Error: [%@]", task.error);
       } else {
          // AWSDynamoDBPaginatedOutput *paginatedOutput = task.result;
           NSLog(@"The request sucesss. Result : [%@]", task.result);
  
       }
       return nil;
   }];
  </code></pre>
  
  <p>}</p>
  
  <p><strong>MyViewController.m</strong></p>
  
  <pre><code> [DynamoDBManager loginWithFaceBook:[result valueForKey:@"id"]];
  </code></pre>
  
  <p>Following s my error:</p>
  
  <pre><code>The request failed. Error: [Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain Code=5 "(null)" UserInfo={__type=InvalidIdentityPoolConfigurationException, message=Invalid identity pool configuration. Check assigned IAM roles for this pool.}]
  </code></pre>
  
  <p>Can anyone having idea about the above error? is any configuration missing in above code?</p>