As a cloud template designer, you use input parameters so that users can make custom selections at request time.

When users supply inputs, you no longer need to save multiple copies of templates that are only slightly different. In addition, inputs can prepare a template for day 2 operations. See How to use cloud template inputs for vRealize Automation day 2 updates.

The following inputs show how you might create one cloud template for a MySQL database server, where users can deploy that one template to different cloud resource environments and apply different capacity and credentials each time.

Input variables

How to define cloud template input parameters

Add an inputs section to your template code, where you set the selectable values.

In the following example, machine size, operating system, and number of clustered servers are selectable.

    type: string
      - small
      - medium
    description: Size of Nodes
    title: Node Size
    type: string
      - coreos
      - ubuntu
    title: Select Image/OS
    type: integer
    default: 2
    maximum: 5
    minimum: 2
    title: Wordpress Cluster Size
    description: Wordpress Cluster Size (Number of nodes)

If you're uncomfortable editing code, you can click the code editor Inputs tab, and enter settings there. The following example shows some inputs for the MySQL database mentioned earlier.

Inputs tab

How to reference cloud template input parameters

Next, in the resources section, you reference an input parameter using ${} syntax.

If a property name includes a space, delimit with square brackets and double quotes instead of using dot notation: ${input["property name"]}

Important: In cloud template code, you cannot use the word input except to indicate an input parameter.
    type: Cloud.Machine
      name: wordpress
      flavor: '${input.wp-size}'
      image: '${input.wp-image}'
      count: '${input.wp-count}'

List of input properties

Property Description
const Used with oneOf. The real value associated with the friendly title.
default Prepopulated value for the input.

The default must be of the correct type. Do not enter a word as the default for an integer.

description User help text for the input.
encrypted Whether to encrypt the input that the user enters, true or false.

Passwords are usually encrypted.

enum A drop-down menu of allowed values.

Use the following example as a format guide.

      - value 1
      - value 2
format Sets the expected format for the input. For example, (25/04/19) supports date-time.

Allows the use of the date picker in vRealize Automation Service Broker custom forms.

items Declares items within an array. Supports number, integer, string, Boolean, or object.
maxItems Maximum number of selectable items within an array.
maxLength Maximum number of characters allowed for a string.

For example, to limit a field to 25 characters, enter maxLength: 25.

maximum Largest allowed value for a number or integer.
minItems Minimum number of selectable items within an array.
minLength Minimum number of characters allowed for a string.
minimum Smallest allowed value for a number or integer.
oneOf Allows the user input form to display a friendly name (title) for a less friendly value (const). If setting a default value, set the const, not the title.

Valid for use with types string, integer, and number.

pattern Allowable characters for string inputs, in regular expression syntax.

For example, '[a-z]+' or '[a-z0-9A-Z@#$]+'

properties Declares the key:value properties block for objects.
readOnly Used to provide a form label only.
title Used with oneOf. The friendly name for a const value. The title appears on the user input form at deployment time.
type Data type of number, integer, string, Boolean, or object.

writeOnly Hides keystrokes behind asterisks in the form. Cannot be used with enum. Appears as a password field in vRealize Automation Service Broker custom forms.

Additional examples

String with enumeration

    type: string
    title: Operating System
    description: The operating system version to use.
      - ubuntu 16.04
      - ubuntu 18.04
    default: ubuntu 16.04

    type: string
    title: Default shell
    Description: The default shell that will be configured for the created user.
      - /bin/bash
      - /bin/sh

Integer with minimum and maximum

    type: integer
    title: Machine Count
    description: The number of machines that you want to deploy.
    maximum: 5
    minimum: 1
    default: 1

Array of objects

    type: array
    title: Tags
    description: Tags that you want applied to the machines.
      type: object
          type: string
          title: Key
          type: string
          title: Value

String with friendly names

    type: string
      - title: AWS
        const: platform:aws
      - title: Azure
        const: platform:azure
      - title: vSphere
        const: platform:vsphere
    default: platform:aws

String with pattern validation

    type: string
    title: Username
    description: The name for the user that will be created when the machine is provisioned.
    pattern: ^[a-zA-Z]+$

String as password

    type: string
    title: Password
    description: The initial password that will be required to logon to the machine. Configured to reset on first login.
    encrypted: true
    writeOnly: true

String as text area

    type: string
    title: SSH public key
    maxLength: 256


    type: boolean
    title: Assign public IP address
    description: Choose whether your machine should be internet facing.
    default: false