Terraform v0.11.7
resource "aws_cognito_user_pool" "main" {
name = "app_env"
schema {
attribute_data_type = "String"
name = "name"
required = true
}
schema {
attribute_data_type = "String"
name = "email"
required = true
}
# extra options
...
}
resource "aws_cognito_user_pool_client" "web" {
name = "web"
user_pool_id = "${aws_cognito_user_pool.main.id}"
read_attributes = ["name", "email"]
write_attributes = ["name", "email"]
# extra options
...
}
Required attributes in cognito are writable by default and calls to cognito API methods should allow modification.
Attributes are set as writable visually in "App Client" -> "Set attribute read and write permissions" but the are not behaving as writable when calling the cognito API method to modify them:
AWSCognitoIdentityProviderService.UpdateUserAttributes
Error response:
{
"__type": "InvalidParameterException",
"message": "Invalid user attributes: name: Attribute cannot be updated.\n"
}
When creating the user pool using amazon console, attributes are writable and calls to AWSCognitoIdentityProviderService.UpdateUserAttributes are working.
Hi, I've had a look into this issue.
At least a workaround was to make sure to mark the attributes are mutable and set them as write_attributes, too.
Most helpful comment
Hi, I've had a look into this issue.
At least a workaround was to make sure to mark the attributes are mutable and set them as write_attributes, too.