Our original colleague’s name was Tomislav or Miroslav, I believe
Time passed since he started receiving daily *slav names upon arrival in the office… Why? Noone remembers exactly, but after a few days, it was obvious that the process needed to be automated
Good friend of mine created music “artist” name generator and shared it with the world as a legendary Polumenta generator. He open-sourced it, so shameless code stealing was obviously the way to go
Script was Python-ized with minor adjustment of adding another ponderized last character, before necessary “слав” ending, based on distribution of actual names of it’s kind. Base64 from indexed 1-bit palette image was supplied along – all ready for FaaS
AWS Lambda
Creating a λ function is trivial – from given hello-world example, without initial trigger, apply code gently
Based on above lambda_handler
function name – and the fact we’re using Python –
here is the overview of configuration options
In order to verify that function returns correct JSON with name and UTF-8 chars, use empty curly brackets for Input test event and validate output
AWS API Gateway
In order to have an URL to invoke the function from, GET request method integration is needed. By default API Gateway returns JSON, so making it present HTML requires a bit of extra work
Three out of four pillars of non-intuitive method execution setup (Method Re{quest,sponse}, Integration Re{quest,sponse}) need to be tweaked in order to achieve that
Changes on the Integration Request are basic
Integration Response, however, demands more alteration. Within HTTP 200 response set Content-Type and define body mapping so that function return is parsed as part of HTML
Content-Type is entered with single quotes and all JSON fields from lambda are accessed via
inputRoot._
Last step before hitting Actions / Deploy API is adding “Content-Type” within Method Response and modifying response body for HTTP 200
Shift-O-Slav
Entry point for the function can now be found under Invoke URL on the Stages editor, after API has been succesfully deployed. All that’s left is to enjoy fresh FaaS Shift-O-Slav name generator