How to Make Friendly Parameters for the CloudFormation Console

Ever order your AWS CloudFormation template parameters perfectly and find out the console lists them in alphabetical order, like the picture below?

Default CloudFormation Parameter Display

Wish you could change parameter labels to something easier to understand rather than a parameter id?

Want to group information together in a meaningful way, such as instance configuration?

You can!

Just add the AWS::CloudFormation::Interface metadata key to your CloudFormation template with the ParameterGroups and ParameterLabels properties. Keep in mind, when we build CloudFormation templates for other people, we want to make the templates as easy to run as possible. This means clear parameter labels, valuable descriptions, and logical parameter arrangements.

First, we’ll use ParameterGroups to divide the database and EC2 parameters into separate sections, “Database Configuration” and “EC2 Configuration”. Then we’ll use ParameterLabels to make friendlier parameter names for our customers.

For this tutorial, we’ll create a CloudFormation template with YAML for readability purposes.

Open your favorite code editor and follow along!

  1. Download the basic LAMP (Linux, Apache, MySQL, PHP) stack template generated by AWS.
  2. Add the code block below to the in between Description and Parameters. Note: Spacing and indentation is important in YAML.
  3. Save the file.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
-
Label:
default: "Database Configuration"
Parameters:
- DBName
- DBUser
- DBPassword
- DBRootPassword
-
Label:
default: "EC2 Configuration"
Parameters:
- InstanceType
- KeyName
- SSHLocation
ParameterLabels:
DBName:
default: "Name"
DBUser:
default: "User"
DBPassword:
default: "Password"
DBRootPassword:
default: "Root Password"
InstanceType:
default: "Instance Type"
KeyName:
default: "Key Pair Name"
SSHLocation:
default: "SSH IP Address Range"

Import the Template

  1. Log into your AWS account.
  2. Select Services.
  3. Click CloudFormation under the Management Tools section.
  4. Click the Create Stack button.
  5. Select Upload a template to Amazon S3.
  6. Click the Choose File button.
  7. Navigate to the file saved in step 3 of the previous section.
  8. Click the Next button.

Now we can see our beautiful, organized, and intuitive parameters in the CloudFormation console.

In conclusion, delight your customers with simple, easy to use, CloudFormation templates. Reorganize parameters in the CloudFormation console with ParameterGroups and use ParameterLabels to create meaningful names. Let me know how it goes in the comments below!