Allow Plugins to provide custom Fn:: functions

Registered by Zane Bitter on 2013-02-06

The idea here is to be able to extend the templating system with your own functions.

This will be based on the same plugin system as used for resources. However functions are a bit trickier: there are two sets of functions we run at different times - ones dealing with static data and ones dealing with runtime data. We may need to provide a way to register each type separately.

We also currently apply functions in a fixed order, which is likely (although not guaranteed) to result in everything in the template being able to be resolved. We'll probably need to fix this so that all functions are guaranteed to resolve no matter their order of nesting.

Blueprint information

Steven Hardy
Zane Bitter
Series goal:
Accepted for icehouse
Milestone target:
milestone icon 2014.1
Started by
Zane Bitter on 2013-02-06
Completed by
Zane Bitter on 2014-03-11

Related branches


(stevebaker) It looks like the direction for HOT is for a small focused group of functions, and implementing some function-type behaviour with resources. Should we obsolete this blueprint for now?

(zaneb) There are some possible architectural benefits (especially with supporting multiple template formats) to doing this work. I'm actually playing around with some stuff at the moment, so let's no obsolete it quite yet.

(pafuent) If I got it right, dependencies among resources are now handled considering only a limited set of specific functions ( Just in case, let's have in mind that this plugin system should also handle all the generated dependecies among resources derived from the plugged custom functions.

Gerrit topic:,topic:bp/function-plugins,n,z

Addressed by:
    Prevent user introspection of Python objects

Addressed by:
    Add a base class for pluggable functions

Addressed by:
    Refactor re-resolving of templates

Addressed by:
    Re-resolve functions during stack update

Addressed by:
    Calculate dependencies based on unresolved template

Addressed by:
    Evaluate lazy functions in autoscaling launch config

Addressed by:
    unit tests: Always resolve static functions

Addressed by:
    Fix test_association_eip unit test

Addressed by:
    unit tests: Fix types in Fn::ResourceFacade tests

Addressed by:
    unit tests: Refactor to accomodate lazy evaluation

Addressed by:
    Replace function resolution with lazy evaluation

Addressed by:
    Move HOT to a separate subpackage

Addressed by:
    Provide access to the template version

Addressed by:
    Disallow Heat-only functions in CloudFormation templates

Addressed by:
    Move built-in functions to separate modules

Addressed by:
    Remove Fn::FindInMap from HOT

Addressed by:
    Give cfn a separate Template class

Addressed by:
    Add a plugin_manager module

Addressed by:
    Use PluginManager to load resources

Addressed by:
    Load functions from plugins

Addressed by:
    Move the code that reads the global environment

Addressed by:
    Docs: use the plugin manager to list resources

Gerrit topic:,topic:typeless-function-plugins,n,z


Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.