CloudFormation Basics

Get an overview of the AWS CloudFormation service and its key concepts.

The AWS CloudFormation service is essentially an AWS tool for dealing with the infrastructure as codeInfrastructure as Code (IaC) is a practice in DevOps where infrastructure provisioning and management are automated using code rather than through manual processes. This approach allows infrastructure to be treated in a similar manner as application code, meaning it can be versioned, reviewed, and tested. on the cloud. It is an automated AWS service that allows us to provision and manage a collection of resources, also called a stack, on the AWS Cloud using code. Almost all of the AWS resources can be created and managed on the cloud.

Press + to interact

We can define AWS resources for their stacks by declaring them in code files called templates. We can provide this template to CloudFormation, which deploys these cloud resources. This avoids creating each resource individually using the AWS console or API themselves.

CloudFormation templates

CloudFormation templates declare resources on the AWS Cloud that we want to create and manage. Templates are written in a declarative language, either JSON or YAML. These templates can be version-controlled, just like any other code. A CloudFormation template is as follows:

{
"AWSTemplateFormatVersion": "version date",
"Description": "String",
"Metadata": {
"template metadata": {}
},
"Parameters": {
"set of parameters": {}
},
"Rules": {
"set of rules": {}
},
"Mappings": {
"set of mappings": {}
},
"Conditions": {
"set of conditions": {}
},
"Transform": {
"set of transforms": {}
},
"Resources": {
"set of resources": {}
},
"Outputs": {
"set of outputs": {}
}
}
The CloudFormation templates
...

Get hands-on with 1400+ tech skills courses.