Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

650
Views
Invalid AttributeDataType input, consider using the provided AttributeDataType enum

I am trying to create aws cognito user pool using aws cdk. below is my code -

user_pool = _cognito.UserPool(
    stack,
    id="user-pool-id",
    user_pool_name="temp-user-pool",
    self_sign_up_enabled=True,
    sign_in_aliases={
        "username": False,
        "email": True
    },
    required_attributes={
        "email": True
    }   
)

I want to set "Attributes" section in User pool for email . But above code gives me this exception -

Invalid AttributeDataType input, consider using the provided AttributeDataType enum. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID:

I have tried many scenarios but it didn't work. Am I missing something here. Any help would be appreciated. Thanks! I was referring this AWS doc to create userpool - https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_cognito/UserPool.html and https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_cognito/RequiredAttributes.html#aws_cdk.aws_cognito.RequiredAttributes

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

According to a comment on this GitHub issue this error is thrown when an attempt is made to modify required attributes for a UserPool. This leaves you two options:

  1. Update the code such that existing attributes are not modified.
  2. Remove the UserPool and create a new one. E.g. cdk destroy followed by cdk deploy will recreate your whole stack (this is probably not what you want if your stack is in production).
over 4 years ago · Santiago Trujillo Report

0

https://github.com/terraform-providers/terraform-provider-aws/issues/3891

Found a way to get around it in production as well, where you don't need to recreate the user pool.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!