get_param

The get_param function obtains the value of input parameters defined in the parameters section.

get_param: <parameter name>

or

get_param:
  - <parameter name>
  - <key/index 1>
  - <key/index 2>
  - ...
Element Required Description
<parameter name> Yes Specifies the name of an input parameter defined in the parameters section.
<key/index 1,2,..> No Specifies the key or index for obtaining data, when the input parameter defined in the parameters section is a list or hash.

Example specification of the get_param function:

parameters:
  instance_type:
    type: string
    label: Instance Type
    description: Instance type to be used.
  server_data:
    type: json

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      flavor: { get_param: instance_type }
      metadata: { get_param: [ server_data, metadata ] }
      key_name: { get_param: [ server_data, keys, 0 ] }

Example input parameter values:

{"instance_type": "S-1",
{"server_data": {"metadata": {"foo": "bar"},
                 "keys": ["a_key","other_key"]}}}
properties Value obtained using get_param
flavor "S-1"
metadata {"foo": "bar"}
key_name "a_key"