Verwenden eines .Net Core 1.0 Lambda Ich möchte in der Lage sein, eine Lambda-Funktion zu erstellen, die den PreSignUp-Trigger aus einem AWS Cognito-Benutzerpool verarbeitet.Erstellen eines AWS Cognito PreSignup Lambda in DotNet
using Amazon.Lambda.Core;
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
public class PreSignUp_SignUp
{
public string userPoolId { get; set; }
public const string EmailKey = "email";
public const string PhoneNumber = "phone_number";
public Dictionary<string,string> userAttributes { get; set; }
public Dictionary<string, string> validationData { get; set; }
}
public class PreSignup_SignUpResponse
{
public bool autoConfirmUser { get; set; }
}
public class Function
{
public PreSignup_SignUpResponse FunctionHandler(PreSignUp_SignUp input, ILambdaContext context)
{
return new PreSignup_SignUpResponse { autoConfirmUser = true };
}
}
Obwohl die Anforderung erfolgreich ist und gibt eine Antwort, wenn das Lambda mit einem Beispiel Anfrage von Aufrufen:
{
"datasetName": "datasetName",
"eventType": "SyncTrigger",
"region": "us-east-1",
"identityId": "identityId",
"datasetRecords": {
"SampleKey2": {
"newValue": "newValue2",
"oldValue": "oldValue2",
"op": "replace"
},
"SampleKey1": {
"newValue": "newValue1",
"oldValue": "oldValue1",
"op": "replace"
}
},
"identityPoolId": "identityPoolId",
"version": 2
}
Wenn eine tatsächliche SignUp über die AmazonCognitoIdentityProviderClient .Net die Durchführung einen Fehler ich zurück:
Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException : Unrecognizable lambda output
Was ich vermute, bedeutet, ich habe nicht die Form der Antwort (und möglicherweise sogar Anfrage) richtig.
Hat jemand ein Beispiel für eine .Net Lambda-Funktion, die für den PreSignUp-Trigger in AWS Cognito funktioniert?