cloudsoft.io

AMP Integration

Maeztro uses the Cloudsoft AMP engine to run, which means:

  • You can access AMP-defined entities, from CAMP or TOSCA, within your Maeztro code, as described under Resource Types
  • You can save Maeztro-defined resources as entities that can be referenced from within AMP, as described below

You can also access all the usual AMP logs, the br CLI, and the AMP Inspector view in the UI. This can be used to get more information on what is being done, or set up access control and/or high availability, or add reusable items to the catalog. See the main AMP documentation for more information on this.

Using Maeztro Definitions from AMP

Maeztro can be used to define entities that can be added to the catalog and reused anywhere in AMP. For instance, you can make a Maeztro application to wrap Terraform and build – for instance – a self-managed federated database. Once you have tested it and it’s working well as an instance with the usual Maeztro flow, you can tear it down and add a catalog.bom definition to turn it in to a registered type entity in AMP.

Once this is done, it can be used in any AMP plan, from TOSCA or CAMP or in another Maeztro application.

To do this, first choose your BUNDLE_NAME and an ENTITY_NAME – these can be the same but need not be. Then create a catalog.bom file in the root of your application with the following contents:

brooklyn.catalog:
  bundle: BUNDLE_NAME                            # CHANGE ME
  version: 1-SNAPSHOT
  items:
    - id: ENTITY_NAME                            # CHANGE ME
      item:
        type: io.cloudsoft.maeztro.amp.base.MaeztroModule
        brooklyn.config:
          mz.application:
            server:
              processors:
                - terraform_hcl_tf_parse
                - maeztro_command_processor
                - terraform_state
                - maeztro_hcl_mz_parse
                - terraform_command_processor
                - amp_seen
            aspects:
              - maeztro-hcl
              - terraform
            client:
              conductors:
                - files
                - terraform_state
            terraform:
              backend_mode: none
              run_terraform_at_server: disabled
              run_terraform_at_client: manual
              refresh_period_millis: 21600000
          mz.source_files_spec:
            bundle: BUNDLE_NAME                  # CHANGE ME
            version: 1-SNAPSHOT

Change the processors and aspects and other mz.application configuration based on your Maeztro application. (You can find these in the .mz_state/ files.)

Then instead of mz init, do a br catalog add . to install it to AMP, (or create a ZIP of the folder which can be added to catalogs via UI or CLI).

Once added, you should see your bundle and entity in the Catalog and the Blueprint Composer in the AMP UI. You can use it like a normal entity:

topology_template:
   node_templates:
      my_instance_of_a_maeztro_defined_application:
         type: ENTITY_NAME
services:
- type: ENTITY_NAME