Resource Identifier Spec (Core42 AI Cloud)¶
Status¶
Accepted baseline for MVP and forward-compatible expansion.
Purpose¶
Define one canonical, machine-readable resource identifier format that can be used consistently across: - API responses, - audit logs, - domain events, - policy evaluation inputs, - runbooks and incident tooling.
This avoids fragmented identifier formats and enables deterministic routing and authorization matching across services.
Canonical Format¶
Example:
core42:aicloud:region-1:2babaf31-19cb-4af7-8065-e676f9e9f6d3:50ab9f5e-cf0c-4d5c-9f78-67dc91b0c8c0:gpuaas/allocation:3a1cae68-3ca7-41e5-99c9-e6d391e84bc5
Segment Semantics¶
core42: organization namespace.aicloud: platform namespace.region: control-plane region code (region-1,us-east-1, etc.).tenant_id: ownership boundary (maps toorganizations.id).project_id: resource scope boundary (maps toprojects.id).resource_type: service-qualified type (gpuaas/allocation,gpuaas/node,storage/object,iam/service-account, etc.).resource_id: stable resource identifier in that type domain (typically UUID).
Grammar¶
resource_name = namespace ":" platform ":" region ":" tenant ":" project ":" rtype ":" rid
namespace = "core42"
platform = "aicloud"
region = 1*(ALPHA / DIGIT / "-" / "_")
tenant = uuid
project = uuid
rtype = service "/" kind
service = 1*(ALPHA / DIGIT / "-" / "_")
kind = 1*(ALPHA / DIGIT / "-" / "_")
rid = 1*(ALPHA / DIGIT / "-" / "_" / "." / "~" / "%")
Encoding Rules¶
resource_idmust be ASCII-safe and deterministic.- If a native ID can contain reserved separators (
:or/), encode before insertion (percent-encoding preferred for MVP). - Identifiers are case-sensitive except fixed namespace/platform constants.
Ownership Rules¶
- For tenant-owned, project-scoped resources,
tenant_idandproject_idare always required. - Platform-scoped resources (rare) are out of this baseline and must use a dedicated documented pattern; do not overload this format with null segments.
Operational Rules¶
- Resource names are immutable for the lifetime of a resource.
- Resource names are external-facing references, not primary database keys.
- Services should store native IDs and synthesize resource names at boundaries (API/event/audit), with optional caching.
Initial Resource Type Registry (MVP)¶
gpuaas/allocationgpuaas/nodestorage/objectiam/service-accountiam/service-account-credential
Policy Integration¶
Policy engines must receive both:
- structured fields (tenant_id, project_id, resource_type, resource_id)
- canonical resource_name
This enables exact-match and prefix/scope matching without re-deriving context.
Error Handling¶
- Parsing failures return
invalid_requestwith details indicating segment mismatch. - Unknown
resource_typereturnsvalidation_errorwhere endpoint requires registry-constrained values.
Adoption Plan¶
- Publish this spec and ADR.
- Add shared parser/formatter helper in code.
- Emit
resource_namein core API responses and domain events. - Include
resource_namein audit logs and operational runbooks.