Inputs

inputs are parameters that are injected into a blueprint when a deployment is created. These parameters can be referenced by using the get_input intrinsic function.

Inputs are useful when there is a need to inject parameters in the blueprint that were unknown when the blueprint was created, and they can be used for distinction between different deployments of the same blueprint.

Also note that you can pass multiple -i flags in the CLI, to pass multiple input structures or to pass wildcard-based paths to input files (e.g. ... -i *.yaml) and directories containing input files (e.g. ... -i my_inputs_file_dir/)

Declaration

inputs:

  input1:
    ...
  input2:
    ...

Schema

Keyname Required Type Description
description no string An optional description for the input.
type no string The required data type of the input. Not specifying a data type means the type can be anything, including a list, an array or a dictionary. Valid types: string, integer, boolean.
default no <any> An optional default value for the input.

Example

inputs:

  image_name:
    description: The image name of the server
    type: string
    default: "Ubuntu 12.04"

  extra_vm_details:
    description: Extra server details
    default:
        key_name: 'my-openstack-key-name'
        all_my_flavors: [ 1, 2, 3, 4 ]

node_templates:

  vm:
    type: cloudify.openstack.nodes.Server
    properties:
      server:
        image_name: { get_input: image_name }
        key_name: { get_input: [ extra_vm_details, key_name ] }
        flavor: { get_input: [ extra_vm_details, all_my_flavors, 0 ] }

get_input is a special function which enables you to use inputs throughout the blueprint. For more information see intrinsic_functions.