get_file

The get_file function references string data.

For example, use this function when referencing content of scripts or configuration files in a non-Heat format.

get_file: <content key>
Element Required Description
<content key> Yes Specifies a key for referencing string data. When executing from the REST API of Heat, the string data mapped in files of the request parameters is referenced.
resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      # general properties ...
      user_data:
        get_file: my_instance_user_data.sh
  my_other_instance:
    type: OS::Nova::Server
    properties:
      # general properties ...
      user_data:
        get_file: http://example.com/my_other_instance_user_data.sh

In the above example, when executing from the REST API, the string data mapped in files of the request parameters is referenced.

"files" : {
  "my_instance_user_data.sh" : "<my_instance_user_data.sh file content(*)>",
  "http://example.com/my_other_instance_user_data.sh" : "<my_other_instance_user_data.sh file content(*)>"
}

(*1) To specify escaped characters, use '\'. For example: return -> \n, " ->\"