AWS CloudFormation

CloudFormation Summary

CloudFormation Logo — https://bit.ly/37miGn0
  • Allows you to provision AWS resources as code.
  • Use templates to define the resources that you want to launch and their dependencies. These templates can either be in JSON or YAML format.
  • You can think of templates as blue prints for creating resources.
  • Can create stacks, which are collections of resources that you can manage in a single template and then you can create, update or delete the entire collection within its stack.
  • If you want to update a stack, you can create a Change Set which can allow you to see how the changes will impact your running resources before implementing the change.
  • CloudFormation overall simplifies infrastructure management and also makes it very easy to replicate infrastructure across different regions.

Template Sections

There are ten valid sections a CloudFormation template can contain, however they are not all required:

  1. Format Version — Version that the template conforms to (Optional)
  2. Description — Describes what the template is used for. This is optional, but if you use it, it needs to follow the Format Version.
  3. MetaData — any additional info about the template. (Optional)
  4. Parameters — Any values that you want to pass into your template at run time. (Optional)
  5. Rules — used to validate parameters passed into the stack (Optional)
  6. Mappings — mapping of key value pairs that can be used to specify conditions (Optional)
  7. Conditions — can control whether a resource is created or whether certain properties are assigned depending on a particular criteria. (Optional)
  8. Transform — used for serverless applications, allows you to specify the SAM version to use (Optional)
  9. Resources — specify the actual resources you want to create (REQUIRED)
  10. Outputs — values that are displayed when you check the stacks properties (Optional)

Serverless Application Model (SAM)

  • Is an open-source framework that extends CloudFormation so that it is optimised for serverless applications (e.g. Lambdas, API’s, databases etc.)
  • It supports anything CloudFormation supports.
  • Also uses templates to define resources and these templates are in a YAML format.
  • Can run serverless applications locally using docker.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store