Imports


Get the latest docs

You are looking at documentation for an older release. Not what you want? Go to the current release documentation.

imports enable the author of a blueprint to reuse blueprint files, or parts of them, and to use predefined types (e.g. from the types.yaml file).

Note

Beginning with definitions version cloudify_dsl_1_3, you can also import inputs, node_templates and outputs multiple times.

Declaration

  
imports:
  - ...
  - ...
  

Example

  

imports:
  - http://www.getcloudify.org/spec/cloudify/3.3/types.yaml
  - my_yaml_files/openstack_types.yaml

node_templates:
  vm:
    type: cloudify.openstack.nodes.Server
  webserver:
    type: cloudify.nodes.WebServer
  

In the above example, the default types.yaml file provided by Cloudify that contains the cloudify.nodes.WebServer node type and a custom YAML that was created for the custom OpenStack plugin, which contains the cloudify.openstack.nodes.Server node typ are imported.

A few important things to know about importing YAML files:

  • Imported files can be either relative to the blueprint’s root directory or be a URL (as seen above).
  • You can use imports within imported files and nest as many imports as you like.
  • An error is returned if there are cyclic imports (i.e. a file is importing itself or you are attempting to import a file that is importing the file that imported it, etc..)
  • Groups cannot be imported and can only be defined in the main blueprint file
  • The tosca_definitions_version as stated here must match across imported files.