/// <summary> /// This method is called for every Lambda invocation. This method takes in an S3 event object and can be used to respond to S3 notifications. /// </summary> /// <param name="input"></param> /// <param name="context"></param> /// <returns></returns> public async Task Handler(S3Event input, ILambdaContext context) { var key = input.Records?[0].S3.Object.Key; var sourceKey = WebUtility.UrlDecode(key); var outputKey = sourceKey.Split('.')[0]; context.Logger.LogLine($"key: {key}, sourceKey: {sourceKey}, outputKey: {outputKey}"); var job = new CreateJobRequest { PipelineId = "1505766337361-sv0ahs", OutputKeyPrefix = $"{outputKey}/", Input = new JobInput { Key = sourceKey }, Outputs = new List <CreateJobOutput>(new[] { new CreateJobOutput { Key = $"{outputKey}-1080p.mp4", PresetId = "1351620000001-000001" }, new CreateJobOutput { Key = $"{outputKey}-720p.mp4", PresetId = "1351620000001-000010" }, new CreateJobOutput { Key = $"{outputKey}-web-720p.mp4", PresetId = "1351620000001-100070" } }) }; await _elasticTranscoder.CreateJobAsync(job); }