AWS CloudFormation Resources Overview
- Core Component: Resources are the core of CloudFormation templates and the only mandatory section.
- Purpose: They represent AWS components that will be created and configured.
- Inter-referencing: Resources can reference each other within a template.
- Automation: AWS handles the creation, updates, and deletion of resources.
- Variety: There are over 700 types of resources available in AWS CloudFormation.
- Identification: Resource type identifiers follow the format
service-provider::service-name::data-type-name.
Finding Resource Documentation
- Resource Documentation Page: A central page exists with documentation for all CloudFormation resources.
- Resource Types: Examples include Amazon Kinesis and Amazon EC2, each with multiple resource types.
- Syntax: Resources can be defined in JSON or YAML, with YAML being easier to read for many users.
- Properties: Defined as key-value pairs, with detailed documentation available for each property.
- Non-Mandatory Properties: Not all properties are required; some are optional.
- Update Behaviors: Documentation specifies if updates to a property require interruption or replacement of the resource.
Example: Amazon EC2 Instance
- Type:
AWS::EC2::Instance
- Properties:
AvailabilityZone, ImageId, InstanceType, IamInstanceProfile, SecurityGroups, etc.
- Security Groups: Defined as an array of strings, referencing security group names.
- Elastic IP: Separate documentation page detailing declaration and examples.
- Customization: Most console-specifiable settings can also be specified through CloudFormation.