As a blueprint developer, you use the input parameters to customize the blueprint so that the deploying user can provide or select values at request time. Input parameters are an easy way to avoid making multiple blueprints.

For example, you create a blueprint for your team to test for the optimal operating system, machine size, and cluster size. Rather than constantly editing values in the blueprint resource properties, you use an input section to provide users with selectable values on the deploy blueprint page.

Example of the input properties on the deployment request page.

The supported input properties are described after the examples.

How Do I Create Blueprint Input Parameters

In the following example, you customize a property so that users can provide or select a value. In inputs, you add definitions so that the requesting user can select from a list for size and image. In addition, the count property creates a modifiable text box that is prepopulated with 2.

Example

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)

In the YAML resources section, you reference the input parameters.

${input.property-name}

You cannot use the word input in blueprint YAML except to indicate an input parameter.

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

For additional examples, see WordPress Use Case: Create and Iteratively Develop a Blueprint.

Input Properties

Blueprint inputs support the following properties.

Table 1. Blueprint Input Properties

Property

Description

type

Specifies the data type: number, integer, string, Boolean, or object.

enum

Creates a drop-down menu containing the allowed values.

Use the following example as a format guide.

enum:
      - value 1
      - value 2

pattern

Allows a regular expression that you can use with the string type.

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

default

Provides a value that populates the option on the deployment request page and is the value submitted unless the requesting user changes it.

The default value must be the same as the type. For example, do not use a word in an integer text box.

description

Provides signpost help text for the option.

You provide a string.

encrypted

Indicates if the input value must be encrypted.

Supported values are true or false.

maxLength

Determines the maximum number of characters allowed for a string field.

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

maximum

Sets the largest allowed value for a number.

You can set the maximum value for numbers and integers.

minLength

Determines the minimum number of characters allowed for a string field.

minimum

Sets the smallest allowed value for a number.

You can set the minimum value for numbers and integers.

required

Indicates whether the user must provide a value or not.

Supported values are true or false.