CloudFormation

  • StackSets

    • Create, update, or delete stacks across multiple accounts and regions with a single operation

    • Same CloudFormation templates to be used, on different multiple/Different AWS accounts use StackSets

  • CloudFormation templates

    • Metadata

    • Parameters

      1. It’s like variables declaration, contains values to pass to your template at runtime

    • Rules

    • Mappings

      1. set values based on a region

      2. use the Fn::FindInMap intrinsic function to retrieve values in a map

    • Conditions

    • Transform

    • Resources

      1. This is the ONLY mandatory field

      2. AWS resources that you want to include in the stack, Ex: EC2 instance or S3 bucket.

    • Outputs

      1. output values that you can import into other stacks

      2. View on the AWS CloudFormation console.

  • Helper scripts

    • cfn-init: install packages, create files, and start services.

    • cfn-signal: synchronize other resources in the stack when the prerequisite resource or application is ready.

    • cfn-get-metadata: retrieve metadata for a resource or path to a specific key.

    • cfn-hup: Use to check for updates to metadata and execute custom hooks when changes are detected.

  • Cross Stack Reference

    • Helps you to simplify cloud formation templates

    • !ImportValue

    • write small scripts for creating SG , subnets, and call them in another script