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:
-
maeztro —
resource 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 Terraformcount
andfor_each
can be used to create indexers with multiple instances -
group —
resource group RESOURCE_ID
will define agroup
resource which dynamically collects as “members” all entities that match a givencondition
; for more information, see [groups.md] -
discovery —
resource group RESOURCE_ID
will define adiscovery
resource which dynamically creates resources based on a discovery workflow, such as cloud resources or trouble tickets; for more information, see [discovery.md] -
amp —
resource 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 arebasic-entity
orworkflow-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 catalogtype
- 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 anmz.resource_type
; these will be returned in the Maeztro model, andapply
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 useTYPE.RESOURCE_ID
syntax and must be unique across a module.
- The AMP catalog type of the resource must be set in an attribute