As a blueprint developer, 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 blueprints that are only slightly different.

For example, you might create one blueprint for a MySQL database server, where users can deploy that one blueprint to different cloud resource environments and apply different capacity and credentials each time.

Input variables

How to create blueprint input parameters

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

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

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

Then, in the resources section, reference an input parameter using ${input.property-name} syntax.

Important:

In blueprint code, you cannot use the word input except to indicate an input parameter.

resources:
  WebTier:
    type: Cloud.Machine
    properties:
      name: wordpress
      flavor: '${input.size}'
      image: '${input.image}'
      count: '${input.count}'

Input properties

Property

Description

type

Data type of number, integer, string, Boolean, or object.

enum

A drop-down menu of allowed values.

Use the following example as a format guide.

enum:
      - value 1
      - value 2

pattern

Allowable characters for string inputs, in regular expression syntax.

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

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.

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.

minLength

Minimum number of characters allowed for a string.

minimum

Smallest allowed value for a number or integer.

required

Whether the user must provide the value, true or false.