Learn CLOUDFORMATION with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Simple CloudFormation Template (YAML)
# cloudformation/demo.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-example-bucket
A simple CloudFormation template to create an S3 bucket.
2
Simple CloudFormation Template (JSON)
# cloudformation/demo.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"MyS3Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "my-example-bucket"
}
}
}
}
A simple CloudFormation template in JSON to create an S3 bucket.