Objectives for the lambda:
- Get a trigger from S3.
- Parse the Event object.
- Trigger a Media Convert Job Create task using the SDK.
Before we dive into the code, a bit about my background in programming. Over the years, I’ve used PHP, Python, C++, C#, Pick, and probably a few other languages for different jobs. The right tool for the right job. Over the last few years I’ve learned more and more on Python because of how easy I find it to get started and how widespread the documentation is.
Let’s look at the code:
The next two sections “Initialize Variables” and “Update Variables with Event data” are very similar. With the exception of syntax differences.
In both cases the code is simple and easy to read. Most of the differences are syntax. Meaning: don’t for get your semi-colons.
The only significant difference was in calling Media Convert. I found the libraries were much better documented and more straightforward to use. I am biased and I am much more familiar with Python and the Boto library, so that probably played a role.
For simple tasks like this it doesn’t really matter what you chose. For me I’ll keep my default of python for now.