Back to articles
December 9, 2024

Infrastructure as Code - Reusable Templates

Reuseable Templates

  • Nested Stacks and Cross-Stack References can be used to modularize stack templates
  • Nested Stacks create a parent-child relationship between the two stacks
    • each time you create a stack from the parent template, a new child stack is created
  • Nested stacks allow sharing sharing infrastructure code across projects, while keeping the stacks completely separate
  • Cross-Stack References allow a stack to export values that other stacks can import
    • promotes service-oriented model with loose coupling
    • allows sharing single set of resources across multiple projects

Template Linting

  • CloudFormation provides the ValidateTemplate API
    • checks for proper JSON or YAML syntax

Summary

  • Information Resource Lifecycle starts with provisioning of resources
    • CloudFormation is a template-based way of creating resources and dependencies
    • Allows maintaining infrastructure the same way as version-controlled source code
Loading comments...