AWS Cloud Formation Template is used to automate the workload component creation using simple scripts on the cloud. Cloud Formation is an Infrastructure-as-a-code (IaaC) offering from AWS. Cloud Formation templates are similar to Terraform / Chef / Ansible- however aren't cloud agnostic. Cloud Formation templates can only be applied on AWS Cloud.
Templates
- it's a text file / YAML or JSON
- it's an input to cloud formation, used to build AWS resources
- it describes the end state of the infrastructure
Stack
- When Cloud Formation executes a template, it creates a stack.
- To update resources within a template, need to update the stack
- A set of related resources, as a single unit is called a stack
Change set
- Summarizes the impact of the update to template before applying to the stack
- Summary helps analyze the impact to live systems in PROD
- impact to existing AWS resources helps take preventive action before applying the stack update
Cloud formation template sections
- JSON or YAML definition file
- AWSTemplateFormatVersion, only valid value 2010-09-09, optional
- Description, optional
- Metadata, provides additional info about the template, optional
- Parameters, allows to pass values into the template at runtime, optional
- Mapping, set of keys & values operate as a lookup table, optional
- Conditions, place conditions to examine whether resources are created, optional
- Transform, specify transforms that cloud formation uses to process the template, optional
- Resources, defines stack resources & their properties
- Outputs, allows to return output from the stack
Intrinsic functions - "Fn::Join": "delim", [comma separated list of values]
Multiple resources - use the same script to configure multiple resources
- most commonly used since a single script covers creating all required resources
Pseudo parameters - similar to global variables, are also intrinsic variables
Reference
No comments:
Post a Comment