Deployment views
Deployment views allow you to visualize the deployment model, using same approach as model views — predicates.
View definition
Section titled “View definition”deployment { environment prod { zone eu { zone zone1 { instanceOf frontend.ui instanceOf backend.api } zone zone2 { instanceOf frontend.ui instanceOf backend.api } instanceOf database } }}views { deployment view index { title 'Production Deployment' link https://likec4.dev
include prod.** // ... }}
View predicates
Section titled “View predicates”Deployment views are based on same predicates as model views.
But they refer to deployment nodes and instances.
Filtering
Section titled “Filtering”Filtering in deployment views use the same principles as in normal views but takes into account deployment nodes, relations and tags defined in deployment model. When condition on element is checked the following rules are applied:
- For a deployment instances tags are combined from tags defined in model and tags defined in deployment model
- For a child of deployment instance the tags defined on child in model are used
- For a deployment node the tags defined in deployment model are used
- For a deployment instances the kind of the model element is used
- For a child of deployment instance the kind of this child is used
- For a deployment node the kind of this deployment node is used
- Tags are not inherited from parent nodes/elements
model { element cloud { element frontend { #next -> backend "rel1" } element backend { #next -> db "rel2" } element db }}deployment { environment prod { // Resulting tags: #alpha #alpha zone eu { // Resulting tags: #beta #beta instanceOf frontend { // Resulting tags: #next, #gamma #gamma } instanceOf backend { // Resulting tags: #next, #sigma #sigma } eu -> prod.db "rel3" } instanceOf db { // Resulting tags: #delta #delta } }}views { deployment view some { include prod.eu.frontend -> prod.eu.backend where source.tag is #next // includes relation "rel1" include prod.eu.frontend -> prod.eu.backend where source.tag is #gamma // includes relation "rel1" include prod.eu -> prod.db where source.tag is #beta // includes relation "rel3" include prod.eu -> prod.db where source.tag is #sigma // does not include any relations include eu.* -> prod.db where source.tag is #sigma // includes relations "rel2" }}
Try it online Open deployment example in LikeC4 playground