liveBook · Manning

CloudFormation parameter

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A CloudFormation parameter is a named input declared by a template whose value can be supplied during stack creation or update.

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

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Defines parameter structure, types, defaults, visibility, and validation constraints without detailing every parameter behavior.
Examples
Uses EC2 instance types, VPCs, subnets, key pairs, WordPress versions, domain names, customer IDs, and database passwords.
What it assumes
Assumes basic YAML and AWS resource familiarity while introducing template parameters alongside resources and outputs.
What you can do after
Apply it via CloudFormation by declaring validated inputs and passing selected values into resource properties.
How it connects
Connects template parameters with CloudFormation stacks, resources, EC2 instances, and declarative infrastructure.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.