See also https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html
Instead of manipulating cloudformation templates locally, Macros allow you to do this in-cloud. Would be interesting to see if the serverless framework can use them, e.g. to automatically extend cloudformation templates with cloudwatch logs etc.