I'm trying to create users to a `UserPool` but con...
# aws
n
I'm trying to create users to a
UserPool
but constantly getting
Attributes did not conform to the schema: User: The attribute User is not defined in schema.
, which is strange, because when I'm doing the same with AWSSDK, it's working. This is the Pulumi failing code:
Copy code
new User($"{appName}_{name}", new() {
					UserPoolId = "us-west-1_grltah6jd",
					Username = "<mailto:a@example.com|a@example.com>",
					Password = "123456",
					Attributes = new InputMap<string> {
						["dev:custom:UserType"] = "1"
					},
				})
(the error is
creating Cognito User (us-west-1_grltah6jd/<mailto:a@example.com|a@example.com>): InvalidParameterException: Attributes did not conform to the schema: User: The attribute User is not defined in schema.
) And this is the working AWSSDK code:
Copy code
client.AdminCreateUserAsync(new AdminCreateUserRequest {
				UserPoolId = "us-west-1_grltah6jd",
				Username = "<mailto:a@example.com|a@example.com>",
				TemporaryPassword = "123456",
				UserAttributes = [
					new() { Name = "dev:custom:UserType", Value = "1" }
				],
				MessageAction = "SUPPRESS"
			}).Result
CloudTrail shows some difference between these two calls, but I can't see the content, as it's replacing it to
HIDDEN_DUE_TO_SECURITY_REASONS
. Here is the failing Pulumi's entry in CloudTrail (only the relevant part):
Copy code
"errorCode": "InvalidParameterException",
    "errorMessage": "Attributes did not conform to the schema: User: The attribute User is not defined in schema.",
    "requestParameters": {
        "userPoolId": "us-west-1_grltah6jd",
        "username": "HIDDEN_DUE_TO_SECURITY_REASONS",
        "userAttributes": "HIDDEN_DUE_TO_SECURITY_REASONS",
        "forceAliasCreation": false
    },
And this is the equivalent CloudTrail part from the successful AWSSDK call:
Copy code
"requestParameters": {
        "userPoolId": "us-west-1_grltah6jd",
        "username": "HIDDEN_DUE_TO_SECURITY_REASONS",
        "userAttributes": "HIDDEN_DUE_TO_SECURITY_REASONS",
        "temporaryPassword": "HIDDEN_DUE_TO_SECURITY_REASONS",
        "forceAliasCreation": false,
        "messageAction": "SUPPRESS"
    },
Any idea what am I'm doing wrong?