Template Middleware Parameters

Cloud Automation Manager variables are definitions of variables that are presented to the deployer when a Template is deployed. This section will describe the format and uses of these variables.

Cloud Automation Manager variables provide the opportunity for an administrator to hardcode certain values for a parameter and make them relevant for a specific organization. Additionally, the deployment properties of variables may be modified to make it suitable for a specific situation.

Cloud Automation Manager variables may be accessed and edited from the Templates tab in the Template Editor.

From GIT, the camvariables.json file describes a set of Cloud Automation Manager variables for a specific template.

Cloud Automation Manager Variables example

The following example shows a sample Cloud Automation Manager variable as it is described in the Parameters section of the Template Editor. To understand the context of this variable, the Terraform template must be inspected.

python
  {
    "name": "referenced-image-image",
    "type": "string",
    "description": "referenced-image OS Image",
    "default": "RHEL-7.3_HVM_GA",
    "hidden": false,
    "label": "referenced-image Image",
    "secured": false,
    "system": false,
    "required": true,
    "immutable": false
  }

This example describes an input variable to a Terraform Template that gets interpretted by Cloud Automation Manager when the template is deployed.

Cloud Automation Manager variables structure

The following is the meta-structure of a Cloud Automation Manager variables file, this in general represents the different sections contained within the file.


Section Definition
input_datatypes

input_datatypes are a collection of attributes. This section defines one or more input_datatypes collections to inject to the template at deploy time the most common being advanced_content_runtime_chef.

You can also use input_datatypes to define Data Types.

output_datatypes After deployment, the this section defines the name of the namespace to be updated post deployment.
input_groups Variables are divided into logical groups. One such use of variable groups is to more efficiently display variables to a deployer in a logical format. This section defines one or more Input Groups associated with a Template.
output_groups This section defines one or more Output Groups associated with a Template.
template_input_params

Templates will accept one or more parameters in order to deploy. As a general rule, these parameters will help populate the Terraform Varibales (.tfvars) file. The input parameters define a list of parameters to be inputted to the Terraform Template during the deployment process. The field definition will dictate how CAM handles these varibales at deploy time.

If you want to get a value from datatype, then you can define the default value, for example, "default": "${datatypedemo1.ipaddress}", where datatypedemo1 is the name of the datatype and ipaddress is the attribute.

template_output_params A list of variables calculated during the deployment process and stored for future reference.

Input Parameter Definition

The following are the relevant field definitions for defining Input Parameters:


Field Definition
name The name of the service parameter.
label The label to be displayed in the user interface for this parameter
description A description for this parameter.
type The type of parameter. E.g. "list, string, map.
default The default value of the parameter. An example default value for shared parameter is "default": "${datatypedemo1.ipaddress}", where datatypedemo1 is the name of the Data Type and ipaddress is an attribute.
hidden Specify if the parameter is not displayed in the user interface. The value must be true or false.
immutable Specify if the parameter is read only. The value must be true or false.
immutable_after_create Specify a value and deploy it for the first time. You cannot edit it in subsequent plan changes. The value must be true or false.
required Specify if the parameter is required. The value must be true or false.
secured Specify if the parameter value is shown as **. The value must be true or false.
validation A validation pattern for the value specified by the user.
dependent Specify if the parameter is dependent from another attribute. The value must be true or false
dependent_attribute The name of the attribute on which the current attribute depends.
return_type The type of the parameter that is returned.
group_name The group to locate this parameter in when displaying on the UI" E.g. "myGroup".
width half (default is full)
options in place of "default" for a list to select from

Output Parameter Definition

The following are the relevant field definitions for defining Output Parameters:


Field Definition
name The name of the service parameter.
label The label to be displayed in the user interface for this parameter
description A description for this parameter.
type The type of parameter. E.g. "list, string, map
hidden Specify if the parameter is not displayed in the user interface. The value must be true or false.
secured Specify if the parameter value is shown as **. The value must be true or false.
return_type The type of the parameter that is returned.
group_name The group to locate this parameter in when displaying on the UI" E.g. "myGroup".

Relationship to templates

Generally, Cloud Automation Manager variables directly relate to the parameters exposed in a terraform template. Cloud Automation Manager variables are used by Cloud Automation Manager to inject terraform parameters at deploy time.