Introduction to CloudFormation
CloudFormation is AWS’ offering for modeling infrastructure as code. Its purpose is similar to that of Salt or Terraform.
Getting started
CloudFormation allows us to define our infrastructure on template
files written in JSON or YAML. The following examples show a template to create an EC2 instance:
1
2
3
4
5
6
7
8
9
10
11
12
{
"Description": "Create a single EC2 instance",
"Resources": {
"Host1": {
"Type" : "AWS::EC2::Instance",
"Properties": {
"InstanceType": "t2.micro",
"ImageId": "ami-003634241a8fcdec0"
}
}
}
}