hamlet-io / engine

Framework for managing cloud infrastructure via templates. It is part of the broader Hamlet devops framework.
GNU General Public License v3.0
5 stars 5 forks source link

Exchanges #1197

Open roleyfoley opened 4 years ago

roleyfoley commented 4 years ago

Exchanges allow for the sharing of information between deployments and will be used to form the basis of links between deployments #933

An exchange is shared component which stores the state ( mainly attributes ) of components that it has been linked to. When a deployment of the exchange is run it collects the attributes and stores them as an output of the exchange. The exchange data format is an extension of the stack output format and allows for codeontap level metadata to be added such as product, environment, segment etc.

[
  {
    "Id" : "widgetapi",
     "qualifers" : { 
          "Product" : "widgetapi",
          "Environemnt" : "int",
          "Segment" : "default",
     }
     "value" : "https://widetapi.integration.com"
     }
   },
   {
    "Id" : "widgetapi",
     "qualifers" : { 
          "Product" : "widgetapi",
          "Environemnt" : "preprod",
          "Segment" : "default",
     }
     "value" : "https://widetapi.preproduction.com"
     }
   }
]

Where exchanges get interesting is when they are linked to, when this happens the dynamic CMDB loading process finds all of the exchange output files in the CMDB overall and merges them together creating a cross product attribute lookup object. Links to exchanges can add additional qualifiers to their search which uses this data.

The introduction of exchanges provides a standardised and controlled mechanism for passing data between products. The exchange can only provide attributes on components that have been explicitly configured to and allows for different versions of CMDBs ( provided they all support exchanges ) to pass data between one another

roleyfoley commented 4 years ago

Also relates to https://github.com/codeontap/codeontap/issues/11 and https://github.com/codeontap/codeontap/issues/13