Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CloudFormation Macros: Transform Your Templates

CloudFormation Macros: Transform Your Templates

The slides to accompany the workshop I gave at the Melbourne AWS Programming and Tools Meetup on July 10, 2019.

Actual workshop code can be found at https://github.com/ArjenSchwarz/workshop-cfn-macros

Last year AWS released CloudFormation Macros and, by doing so, gave us the ability to fully customise our CloudFormation templates. Macros run as Lambda functions that you write yourself and CloudFormation will allow these functions to change your templates in any way you want them to.
This can be anything you imagine; duplicating entries, ensuring naming standards, pulling information from S3, up to and including writing your own custom templates that create a complete environment. In this workshop we'll take a first step in this process by building one such Macro and laying the groundwork for you to create your own.

Arjen Schwarz

July 10, 2019
Tweet

More Decks by Arjen Schwarz

Other Decks in Technology

Transcript

  1. CloudFormation Macros Transform your Templates Melbourne AWS Programming and Tools

    Meetup July 10, 2019 Arjen Schwarz
 Lead Platform Engineer @ DigIO
  2. Hi • Lead Platform Engineer @ DigIO • APN Ambassador

    @ DigIO/CMD • Organise @ AWS User Group Melbourne • Write @ ig.nore.me 2
  3. 8 AWSTemplateFormatVersion: "2010-09-09" Description: Lots of buckets Resources: Bucket1: Type:

    AWS::S3::Bucket Bucket2: Type: AWS::S3::Bucket Bucket3: Type: AWS::S3::Bucket Bucket4: Type: AWS::S3::Bucket
  4. 22

  5. 23

  6. Step 1 25 • S3 Bucket for deploying Lambda code

    • cfn-lint (optional) • Pick your language • Ensure the Macro can pass through the template https://github.com/ArjenSchwarz/workshop-cfn-macros
  7. 26

  8. Step 4 29 • Finishing touches (optional) • Build the

    CloudFormation template • Deploy the template
  9. Done! 30 • Test your function with the provided template

    • Think about what you want to build