Create a CloudFormation template

You can define a template that describes the AWS resources, and any associated dependencies or runtime parameters required to run your application

Before you begin

Role required: cloud_admin or admin

Procedure

  1. Navigate to Amazon AWS Cloud > CloudFormation > Templates.
  2. Click New.
  3. Enter a Name and Description for the template.
  4. CloudFormation template parameters enable you to pass values into the template at stack-creation time. Parameters let you create templates that can be customized for each stack deployment. To use a JSON template that contains parameters to include in the template, click Use JSON and then enter the template code in the text box.
  5. Optional. Enter the URL of an existing template in the Amazon S3 Template URL text box. The URL should point to an S3 bucket containing a CloudFormation template in JSON format.
  6. Click Submit.

CloudFormation templates

You can create CloudFormation templates or use an existing Amazon template to describe the AWS resources and any associated dependencies or runtime parameters required to run your application.

You can add a template that you define as a catalog item in the Service Catalog. The system can then use the template to create and launch stacks.

In addition, you can configure CloudFormation template parameters that enable you to pass values into the template at stack-creation time.

Configure parameters for a CloudFormation template

Parameters let you create templates that can be customized for each stack deployment. When creating a stack from a template that contains parameters, you can specify values for the parameters.

Before you begin

Role required: cloud_admin or admin

About this task

If you specified a JSON template that contains parameters, the template parameters appear on the CloudFormation Template Parameters tab and the variable set appears in the CloudFormation Variable Set for Template Parameter tab.

The following example shows the KeyPairName and InstanceType parameters:

"Parameters" : {
    "KeyPairName": {
      "Description" : "Name of an existing Amazon EC2 key pair for RDP access",
      "Type": "String",
    },
    "InstanceType": {
      "Description" : "Amazon EC2 instance type",
      "Type": "String",
    }
}

Procedure

Each parameter name must be alphanumeric and unique among the parameters in the template. You can declare a parameter as any of the following data types:
Note: An error message appears if you attempt to submit a template with an invalid parameter type.
OptionDescription
Data Type Description
String String of numbers or letters.
Number An integer. If you use the parameter elsewhere in the template, then the parameter value becomes a string.
List<Number> An array of integers that are separated by commas. If you use the parameter elsewhere in the template, the parameter values becomes a list of strings.
CommaDelimitedList An array of strings that are separated by commas.
AWS::EC2::KeyPair::KeyName (AWS-specific data type) An Amazon EC2 key pair name.
AWS::EC2::SecurityGroup::Id (AWS-specific data type) A security group ID number.
AWS::EC2::Subnet::Id (AWS-specific data type) A subnet ID number.
AWS::EC2::VPC::Id(AWS-specific data type) A VPC ID number.
List<AWS::EC2::VPC::Id> (AWS-specific data type) An array of VPC ID numbers.
List<AWS::EC2::SecurityGroup::Id> (AWS-specific data type) An array of security group ID numbers.
List<AWS::EC2::Subnet::Id> (AWS-specific data type) An array of subnet ID numbers.

Configure the NoEcho parameter

A parameter value with NoEcho set to true is masked from the requester and is not visible while ordering the catalog item. If the NoEcho parameter is set to false or is removed from the template, then the actual plain text value of the parameter is shown.

Before you begin

Role required: cloud_admin or admin

About this task

If the parameter has NoEcho set to true and a change is requested, then the change definition form has an empty parameter field to signify that the previous value is masked and the actual value cannot be verified. If it is set to false, the text value of the parameter is shown in the change definition form.

Note: While a CloudFormation stack is performing an update request, the NoEcho field for a parameter can only be modified through the template definition.

Procedure

Define the NoEcho parameter by setting NoEcho to true in a stack template parameter definition..
NoEcho parameter