Introduction
- Infrastructure as Code service in AWS Platform
- Manual Creation and Custom Scripts are not flexible for manipulating the resources
Why Cloud Formation
- What if more than one service is to be used in AWS Platform ?
- Easy to automate the infrastructure orchestration process
How Cloud Formation works?
Terminologies
- Template
- Stack
Anatomy of Template in YAML
AWSTemplateFormatVersion:
Description: (optional)
Parameters: (Optional) (Input Custom Values to the template)
Mappings: (Optional)(By using one value to map the needy V)
Resources: (Important)
Outputs:(Optional)
Template Example
Resources:
MyInstance :
Type: AWS::EC2::Instance (Resource Type)
Properties :
AvailabilityZone : us-east-1a
ImageId: ami-a4c7edb2
InstanceType : t2.micro
Intrinsic Functions
Cloud Formation has many built-in operations for many operations.
EXAMPLE:
Fn::FindInMap
Fn::Ref
Fn::Join
( Fn:: can also be denoted as !)