Cloudformation 101
CloudFormation Overview
Declarative Infrastructure as Code
Templates and Stacks
# CloudFormation Template
AWSTemplateFormatVersion: '2010-09-09' # Version of the CloudFormation template syntax
Description: 'A simple CloudFormation template' # Description of the template
Resources: # Section where AWS resources are defined
MyEC2Instance: # Logical name of the resource
Type: 'AWS::EC2::Instance' # Type of AWS resource being created
Properties: # Properties specific to the resource type
ImageId: 'ami-12345678' # ID of the Amazon Machine Image (AMI) for the EC2 instance
InstanceType: 't2.micro' # Type of EC2 instance
KeyName: 'my-key-pair' # SSH key pair for accessing the instance
MyS3Bucket: # Another resource example
Type: 'AWS::S3::Bucket'
Properties:
BucketName: 'my-s3-bucket' # Name of the S3 bucket
Outputs: # Section to define outputs for the template
EC2InstanceId: # Logical name for the output
Description: 'ID of the EC2 instance' # Description of the output
Value: !Ref MyEC2Instance # Reference to the EC2 instance resourceCloudFormation Architecture
Main and Worker Architecture
Template Processing Flow

Event-Driven Model
Rollback and Rollback Triggers
Cross-Stack References
Last updated