An AWS CloudFormation template is a JSON or YAML formatted text file. It usually contains these main sections:
-
AWSTemplateFormatVersion (optional)
-
The template version (latest =
"2010-09-09").
-
-
Description (optional)
-
Human-readable description of the template’s purpose.
-
-
Metadata (optional)
-
Additional information about the template (can be used by tools).
-
-
Parameters (optional)
-
Input values that let you customize templates at runtime.
-
-
Mappings (optional)
-
Hardcoded lookup tables (e.g., AMI IDs per region).
-
-
Conditions (optional)
-
Control resource creation depending on parameter values or other logic.
-
-
Transform (optional)
-
For including and processing macros (like
AWS::IncludeorAWS::Serverless).
-
-
Resources (required)
-
The core section – defines the AWS resources (EC2, S3, Lambda, etc.) that CloudFormation creates and manages.
-
-
Outputs (optional)
-
Values you want to return (e.g., VPC ID, Load Balancer DNS, etc.).
Example 1: Minimal Template (S3 Bucket) — JSON
No comments:
Post a Comment