cloudsoft.io

Resource Types

For special behavior, Maeztro requires that each resource block specify its “type”. The simplest and most common resource type is maeztro, which has no special behavior beyond the usual Maeztro capabilities. Other types are used for instance for dynamic grouping or when wanting to use pre-defined Cloudsoft AMP types from the catalog.

All Maeztro resource types allow config, children, sensors, widgets, effectors, policies, and initializers, as described for resource blocks here.

The out-of-the-box types are as follows:

  • maeztroresource maeztro RESOURCE_ID will define a standard new pure-Maeztro resource in the tree, with no special behavior beyond that for all resource types in Maeztro; as with Terraform count and for_each can be used to create indexers with multiple instances

  • groupresource group RESOURCE_ID will define a group resource which dynamically collects as “members” all entities that match a given condition; for more information, see [groups.md]

  • discoveryresource group RESOURCE_ID will define a discovery resource which dynamically creates resources based on a discovery workflow, such as cloud resources or trouble tickets; for more information, see [discovery.md]

  • ampresource amp RESOURCE_ID allows the use of entity types defined in the AMP catalog

    • The AMP catalog type of the resource must be set in an attribute type; examples of this are basic-entity or workflow-entity
    • Config, sensors, effectors, initializers, and policies can be set in the the mz code block for the resource, and are applied to the typed entity in addition to those defined by the catalog type
    • Non-Maeztro resources, created in workflow or by an AMP type using AMP entity specs, can also be displayed in Maeztro by setting the mz.resource_address config key, but not setting an mz.resource_type; these will be returned in the Maeztro model, and apply blocks will take effect, but unlike normal resources defined in MZ or TF code, these will not be removed by Maeztro if they do not have MZ or TF resource block definitions. As with Terraform and other resources, these resource addresses should use TYPE.RESOURCE_ID syntax and must be unique across a module.