A CloudFormation parameter is a named, typed input declared by a template. Supplying values during stack creation or update lets one template support choices such as an instance type, domain name, customer ID, or database password. section 4.5.1 section 4.5.2
Define parameters with a name, type, and usually a description; add constraints when they improve safe and predictable input.
- Use String, Number, CommaDelimitedList, resource identifiers, Availability Zones, key-pair names, security-group IDs, subnet IDs, and related list types. section 4.5.1
- Set Default for an optional starting value, NoEcho to hide values in graphical tools, and AllowedValues or AllowedPattern to restrict choices. section 4.5.1
- Use MinLength and MaxLength for strings, MinValue and MaxValue for Number parameters, and ConstraintDescription to explain rejected input. section 4.5.1
Selecting an EC2 instance type
Declare an InstanceType parameter with String type, default it to t2.micro, and allow t2.micro, t2.small, or t2.medium. Reference it from the EC2 resource's InstanceType property. During stack creation, select the desired value instead of editing the resource definition. section 4.5.2
