James Alexander
Andrew Kaczorek
Chris Chalfant
[assembly : LambdaSerializer (typeof (Amazon.Lambda.Serialization.Json.JsonSerializer))]
public class LambdaParameters {
public string Name { get; set; }
public string Comment { get; set; }
public bool ShouldRun { get; set; }
public int QueueDepth { get; set; }
public int ActiveRunningLoaders { get; set; }
public int LoadersToRun { get; set; }
public int MaxLoaders { get; set; }
public string Bucket { get; set; }
public string Key { get; set; }
public override string ToString()
{
return $"Parameters: Comment: {Comment} - QueueDepth: {QueueDepth}";
}
}
public class LoaderLambda {
public int Trigger (SNSEvent evnt, ILambdaContext context) { ... }
public LambdaParameters ShouldContinueRunning(LambdaParameters p, ILambdaContext context) { ... }
public LambdaParameters GetQueueDepth(LambdaParameters p, ILambdaContext context) { ... }
public LambdaParameters GetActiveRunningLoaders(LambdaParameters p, ILambdaContext context) { ... }
public LambdaParameters GetMaxLoaders(LambdaParameters p, ILambdaContext context) { ... }
public LambdaParameters StartLoaders(LambdaParameters p, ILambdaContext context) { ... }
}
{
"profile": "local-aws-profile",
"region" : "us-east-1",
"configuration": "Release",
"framework": "netcoreapp2.0",
"function-runtime": "dotnetcore2.0",
"function-memory-size": 256,
"function-timeout": 30,
"function-role": "aws-iam-role",
"function-handler": "AwsLambda::AwsLambda.LoaderLambda::Trigger"
}
aws-lambda-tools-defaults.json
dotnet lambda deploy-function dev-loader-task-step --function-role aws-iam-role
PS
http://bit.ly/sqs-sns