Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Error: error updating Cognito User Pool (eu-central-1_sjGWqeJzG): unable to add custom attributes from schema: InvalidParameterException: Required custom attributes are not supported currently.
│
│ with module.cognito.aws_cognito_user_pool.user_pool,
│ on ../../modules/cognito/main.tf line 1, in resource "aws_cognito_user_pool" "user_pool":
│ 1: resource "aws_cognito_user_pool" "user_pool" {
Steps to Reproduce
terraform apply
Important Factoids
This only happens when adding schema block with required attribute to already created aws_cognito_user_pool resource. AWS cannot update required attributes (only during the creation of the resource), but Terraform is trying to update the resource, therefore trying to add custom attribute.
Workaround
Delete Cognito user pool resource using AWS Console manually and recreate it using terraform apply.
Community Note
Terraform CLI and Terraform AWS Provider Version
AWS v3.74.1 CLI v1.1.5
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Apply operation occur just fine
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
This only happens when adding schema block with required attribute to already created aws_cognito_user_pool resource. AWS cannot update required attributes (only during the creation of the resource), but Terraform is trying to update the resource, therefore trying to add custom attribute.
Workaround
Delete Cognito user pool resource using AWS Console manually and recreate it using
terraform apply
.