Search code examples
amazon-web-servicesamazon-cognito

An error occurred(LimitExceededException) when calling the AdminCreateUser operation using Python boto3


I'm using Python Boto3 to create Cognito User accounts. There are around 9000 User accounts received in a csv file and it will be fetched by an Airflow job to create the Cognito accounts.

The workflow will be like this,

The admin_create_user method will be called for each user 1.1 If the user account is already present, then UsernameExistsException is raised. In this case only the user attributes needs to be updated. For updating user attributes I'm using admin_update_user_attributes method 1.2 If a new user, then an account will be created The admin_create_user works as expected for first few entries(up to 50 users), then I'm receiving below error

An error occurred (LimitExceededException) when calling the AdminCreateUser operation: Exceeded daily email limit for the operation or the account. If a higher limit is required, please configure your user pool to use your own Amazon SES configuration for sending email.

Using admin account, I checked further the Amazon SES config and found that my AWS account is production account with 50000 emails per day and 14 emails per second.

Though having 50000 email limit per day, why I'm still receiving the exception while creating the user account


Solution

  • Amazon Cognito can use its default email functionality to handle email deliveries for you.

    When you use the default option, Amazon Cognito limits the number of emails it sends each day for your user pool which has a limit of 50 email messages per region in an AWS account

    This quota applies only if you are using the default email feature for an Amazon Cognito user pool.

    To enable a higher email delivery volume, configure your user pool to use your Amazon SES email configuration.

    For more information, see Email settings for Amazon Cognito user pools.