Object References

This chapter describes how to reference external data and objects from within your configuration definition.

Referencing External Objects

The Configuration Importer enables you to reference externally-stored data in your configuration documents. This method can help keep your configuration documents neater, and allows configuration such as TrafficScript rules and certificates to be stored in their native format. It also allows data to be pulled in from other sources when needed. For example, in a Kubernetes environment, passwords and certificates could be mounted from Secret objects and referenced inside your Traffic Manager configuration definition.

To reference externally-stored data in your configuration, use the "valueFrom" construct. The example that follows shows how to import a TrafficScript rule stored in a separate file:

/import/config/rule-config.yaml

rules:

- name: example-rule

content:

valueFrom:

fileRef:

name: data/example-rule.zts

 

/import/data/example-rule.zts

log.info("Hello World");

http.sendResponse("200 OK", "text/plain", "Hello World", "X-Served-By: Ivanti vTM");

The Configuration Importer replaces the valueFrom statement in the configuration document with the literal text of the rule and applies the resulting configuration to the Traffic Manager.