CloudFormation vs Ansible / Terraform
CloudFormation being AWS native will always containt the latest features and options for AWS services
CloudFormation is state based, AWS figures out how best to reach that state
Ansible and Terraform are instrution based, so it can be difficult to fully orchestrate stacks
Ansible and Terraform have to be updated each a new service or API is released, which can take a long time
YAML
Key - Value pairs
Nested objects (tab)
Supports arrays (-)
Multi line strings (|)
Coments (#)
Updates
Update with no interruption
Replacement updates
Template Options
Tags (up to 50)
Permissions (IAM role that creates the CloudFormation resources)
Notification Options (SNS Topic)
Timeouts (in minutes)
Rollback configuration (Specify alarms for CloudFormation to monitor when creating and updating the stack.)
Rollback on Failure (Yes/No)
Stack Policy (Defines the resources that you want to protect from unintentional updates during a stack update.)
Building Blocks
Components
Resources: your AWS resources declared in the template
Parameters: the dynamic inputs for your template
Mappings: the static variables for your template
Outputs: References to what has been created
Conditionals: List of conditions to perform resource creation
Metadata
Template Helpers
References
Functions
Parameters
Type
String
Number
CommaDelimitedList
List
AWS Parameter (to catch invalid values, match against exiting AWS account values)
Description
Constraints
Constraint Description (String)
Min/MaxLength
Min/MaxValue
Defaults
AllowedValues (array)
AllowPattern (regexp)
NoEcho (Boolean)
Fn:Ref == ! Ref, function reference parameters or other elements in the template
Resources
Last updated
Was this helpful?