Skip to main content

Custom Attributes (attr)

While Scapius provides a comprehensive set of built-in properties, enterprise architecture teams frequently need to record bespoke metadata, FinOps cost codes, compliance identifiers, and cloud provider tags.

The attr keyword allows defining namespaced key-value pairs on any entity or relationship.


Syntax

attr (<namespace>:)*<attribute_name> <value>
  • Namespace (optional): snake_case prefix indicating the domain (e.g. aws, finops, sec, k8s).
  • Attribute Name: snake_case identifier.
  • Value: String ("value"), Boolean (true / false), or Numeric literal (123, 99.9).

Usage on Entities

system sys_order_router "Order Router" {
# Custom cloud metadata
attr aws:account_id "123456789012"
attr aws:region "us-east-1"

# FinOps metadata
attr finops:cost_center "CC-9012"
attr finops:chargeback_enabled true

# Custom security categorization
attr sec:cmdb_id "CMDB-SYS-4410"
attr sec:critical_infrastructure true
}

Usage on Relationships

Custom attributes can also be attached to relationship property blocks:

sys_order_router flows_to sys_warehouse "Transfers packing slips" {
attr net:protocol "mTLS"
attr net:port 8443
attr kafka:topic "orders.fulfillment.v1"
}

Best Practices for Namespaces

Namespace PrefixRecommended UsageExample
cloud: / aws: / azure:Cloud provider runtime metadataattr cloud:vpc "vpc-0a81"
finops:Cost centers, chargeback allocationsattr finops:cost_center "CORP-IT"
sec:Security classifications & CMDB tagsattr sec:data_steward "Jane Doe"
arch:Architecture review board trackingattr arch:arb_approval_date "2026-04-01"

Querying Custom Attributes in Views & Styles

Custom attributes are first-class query targets in view where clauses and style rule predicates using the attr.<namespace:attribute_name> syntax:

views {
landscape cloud_landscape "US-East AWS Landscape" {
# Filter entities matching custom attribute queries
include system where attr.aws:region == "us-east-1"
exclude system where attr.finops:chargeback_enabled == false

# Apply predicate-based conditional styling to custom attributes
style system where attr.sec:critical_infrastructure == true {
css_class "critical-border"
}
}
}

The predicate evaluator automatically infers and resolves attribute types (string, boolean, or numeric) and supports equality (==, !=), string matching (contains, starts_with, ends_with), and comparison operators (>, <, >=, <=).