If you created your identity pool before February 2015, you will need to reassociate your roles with your identity pool in order to use the AWS.CognitoIdentityCredentials constructor without the roles as parameters. To do so, open the Amazon Cognito console, choose Manage Identity Pools, select your identity pool, choose Edit Identity Pool, specify your authenticated and unauthenticated roles …
https://docs.aws.amazon.com/cognito/latest/developerguide/getting-credentials.html

