chapter three
3 Building a Mad Libs Template Engine
This chapter covers:
- Incorporating multiple providers in a single project
- Parameterizing configuration files with input variables
- Usage of interpolation functions within template files
- Validating and transforming data with expressions and functions
- Creating dynamic Terraform configurations with count
Mad Libs, in case you don’t know, is a phrasal templating word game in which one player prompts another for words to fill in the blanks of a story, before reading the (often zany) story aloud. If you’ve ever played Apples to Apples or Cards against Humanity, it’s a lot like that except with a whole story rather than a single sentence or two. What makes these kinds of games funny is the juxtaposition that exists between an otherwise normal story, and the odd words chosen to fill in the blanks.