It is a recommended best practise in AWS to create a CloudFormation stack for each application per environment or even single instances. Reason include self-documenting and repeatability for those new to the its purpose and design but also allow more thorough inventory of resources by processing stacks. CloudFormation allows upfront architecture review prior to implementation.
The service itself has no costs other than that the stack are stored in S3 but those costs are minimal.
Multi-accounts: Currently resources outside the account in which the stacks are created (such as Route 53 in another account) are not accessible in CloudFormation.
All resources referenced in a stack will be deleted when the stack is deleted including a shared resource with other applications. Care should be taken to either using a separate stack for shared resources or reference the entire shared applications as one stack.
When the template is submitted to the service, CloudFormation creates the necessary resources in the AWS account and builds a running instance of the template, putting dependencies and data flows in the right order automatically. The running instance and collection of resources used by it is referred to as a stack.
Changes to the stack can be made after it’s been deployed by using CloudFormation tools and an editing process that is similar to version control. When a stack is deleted, all related resources are deleted automatically as well.
Notes on CloudFormation
See page Kevin's AWS CloudFormation Notes.
AWS Class on Adv Ops course
See page AWS Class: AWS Advanced Operations
Tools and generators
- AWS CloudFormation Designer - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer.html
- Troposphere - See page Troposphere.
- Cumulus. Helps manage AWS CloudFormation stacks - https://github.com/cotdsa/cumulus
- Updating a stack. When to update? When to make a new stack. - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html
- Nesting stacks - http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html, https://blogs.aws.amazon.com/application-management/post/Tx1T9JYQOS8AB9I/Use-Nested-Stacks-to-Create-Reusable-Templates-and-Support-Role-Specialization and http://cloudacademy.com/blog/understanding-nested-cloudformation-stacks/
- Eclipse - https://java.awsblog.com/post/Tx1V52C59HQD149/Working-with-AWS-CloudFormation-in-Eclipse
- Packer - http://www.packer.io/intro
- Terraform - https://www.terraform.io/ and https://github.com/hashicorp/terraform