Referencing Node Properties

Many nodes have intrinsic properties that are referenceable by Function and Docker Service compute nodes. For example, a Database node has address and port properties that can be referenced as values for Docker Service Environment Variables.

Referencing node properties enables compute nodes to access other node resources directly. For example, unlike Function nodes, Docker Service nodes do not have intrinsic output functionality for sending messages to other nodes. However, a Docker Service could have an Environment Variable that refers to the ID of a Function node deployed in the same stack. This ID can be used with the cloud provider’s SDK to invoke the Function directly. Likewise, a Function node could have an Environment Variable that refers to the address of a Database node in order to connect to the database using a SQL library.

Referenceable Properties

A list of referenceable properties may be found in the documentation for each node type.

Referencing Properties

Node properties can be referenced as environment variable values of compute nodes: Functions and Docker Services. Properties are referenced using a variable reference syntax: ${node.<node name>.<property>} or ${node.<node ID>.<property>}. When using the node name to refer to a node, strings of invalid characters (characters other than alphanumeric, ‘_’ and ‘-‘) are collapsed to a single ‘_’ character. For example, the node name My Hello World!!! becomes My_Hello_World_. For convenience, property references are suggested for autocompletion in the environment variable value fields within the Stackery editor.

Try Stackery For Free

Gain control and visibility of your serverless operations from architecture design to application deployment and infrastructure monitoring.