Skip to main content

Resource Type YAML Specification

A resource type is a directory with a massdriver.yaml. It holds the type's JSON Schema, and references import instructions and export templates as separate files. It replaces the deprecated raw JSON schema format, and it is the only format that supports versions.

File Structure​

A resource type directory:

my-resource-type/
├── massdriver.yaml # The definition
├── README.md # Published
├── CHANGELOG.md # Published
├── icon.svg # Published (also icon.png, icon.jpg, icon.jpeg)
├── instructions/ # Import instruction markdown files
│ ├── step1.md
│ └── step2.md
└── exports/ # Export template files
└── config.yaml.liquid

Complete Specification​

yaml
# =============================================================================
# RESOURCE TYPE METADATA
# =============================================================================

# name (required)
# Unique in your organization. It is also the name of the type's
# repository. Pattern: ^[a-z0-9-]{3,100}$
name: my-resource-type-name

# version (required to publish)
# Semantic version, MAJOR.MINOR.PATCH. Published as the repository's tag.
# A published version cannot be republished.
version: 2.1.0

# label (recommended)
# Display name in the UI.
label: My Resource Type Display Name

# icon (optional)
# URL of the type's icon. An HTTPS URL or a data URL.
icon: https://example.com/my-icon.svg

# =============================================================================
# UI CONFIGURATION
# =============================================================================

# ui (optional)
ui:
# connectionOrientation (optional, default: link)
# - link: resources of this type can be linked on the canvas
# - environmentDefault: resources of this type are used only as
# environment defaults, not linked on the canvas
connectionOrientation: link

# environmentDefaultGroup (optional)
# "credentials" marks a cloud credential type. The UI shows credential
# types apart from an environment's other defaults.
environmentDefaultGroup: credentials

# instructions (optional)
# Steps shown when someone imports a resource of this type.
instructions:
# label: the step's title
# path: relative path to a markdown file
- label: Prerequisites
path: ./instructions/prerequisites.md
- label: Create Service Account
path: ./instructions/create-service-account.md
- label: Configure Access
path: ./instructions/configure-access.md

# schema (optional)
# RJSF uiSchema for the import form. Keys match the property names in the
# top-level `schema`. Massdriver stores it as is and does not validate the
# ui:* directives. A value that is not an object is dropped.
# See: https://react-jsonschema-form.readthedocs.io/en/docs/api-reference/uiSchema/
schema:
ui:order:
- infrastructure
- authentication
- "*"
authentication:
password:
ui:widget: password

# =============================================================================
# EXPORT TEMPLATES
# =============================================================================

# exports (optional)
# Files rendered from a resource's payload, such as a kubeconfig or a .env
# file. Each one is a download in the UI and a format for
# `mass resource download --format` and `exportResource`.
exports:
# downloadButtonText: label of the download button
# fileFormat: file extension, lowercase letters and digits (yaml, env, ...)
# templatePath: relative path to the Liquid template
# templateLang: liquid (the only value)
- downloadButtonText: Download Kubeconfig
fileFormat: yaml
templatePath: ./exports/kubeconfig.yaml.liquid
templateLang: liquid

- downloadButtonText: Download .env
fileFormat: env
templatePath: ./exports/dotenv.liquid
templateLang: liquid

# =============================================================================
# JSON SCHEMA DEFINITION
# =============================================================================

# schema (required)
# JSON Schema that every resource of this type must validate against.
schema:
# title (recommended)
title: My Resource Type

# description (optional)
description: |
Describes a connection to a managed database service including
authentication credentials and infrastructure identifiers.

# type (required): must be "object"
type: object

# additionalProperties (recommended): false rejects unknown fields
additionalProperties: false

# required (recommended)
required:
- infrastructure
- authentication

# properties (required)
# Common groups: infrastructure, authentication, iam, cloud, specs
properties:
# infrastructure: Cloud resource identifiers (ARNs, IDs, regions)
infrastructure:
title: Infrastructure
description: Cloud resource identifiers and metadata
type: object
required:
- arn
- region
properties:
arn:
title: ARN
description: Amazon Resource Name
type: string
pattern: "^arn:aws:[a-z0-9-]+:[a-z0-9-]*:[0-9]*:.+$"
# Custom error message for pattern validation
message:
pattern: Must be a valid AWS ARN
region:
title: Region
description: AWS region where the resource is deployed
type: string

# authentication: Credentials and connection details
authentication:
title: Authentication
description: Connection credentials
type: object
required:
- hostname
- port
- username
- password
properties:
hostname:
title: Hostname
description: Database endpoint hostname
type: string
port:
title: Port
description: Database port number
type: integer
minimum: 1
maximum: 65535
username:
title: Username
description: Database username
type: string
password:
title: Password
description: Database password
type: string
# Masked in the API and UI. A deployment gets the value.
# Write it as the flat key $md.sensitive.
$md.sensitive: true

# iam: roles keyed by name, with patternProperties
iam:
title: IAM
description: IAM roles and scopes for this resource
type: object
additionalProperties: false
# Keys are lowercase with underscores, such as read, write, admin
patternProperties:
"^[a-z]+[a-z_]*[a-z]$":
type: object
required:
- role
- scope
properties:
role:
title: Role
description: Cloud IAM role name
type: string
examples:
- Data Reader
- Data Writer
scope:
title: Scope
description: Cloud resource identifier the role applies to
type: string

# cloud: Cloud provider metadata
cloud:
title: Cloud
description: Cloud provider information
type: object
properties:
provider:
title: Provider
description: Cloud provider name
type: string
enum:
- aws
- gcp
- azure
region:
title: Region
description: Cloud region
type: string

# specs: versions and sizing
specs:
title: Specs
description: Resource specifications
type: object
properties:
version:
title: Version
description: Software/service version
type: string
tier:
title: Tier
description: Service tier or instance type
type: string

Minimal Example​

Only the required fields, plus a label:

yaml
name: simple-credential
label: Simple Credential
icon: https://example.com/icon.png

schema:
title: Simple Credential
type: object
required:
- token
properties:
token:
title: API Token
type: string
$md.sensitive: true

Complete Example with All Features​

A database credential type:

yaml
name: postgres-database
label: PostgreSQL Database
icon: https://cdn.example.com/postgres-icon.svg

ui:
connectionOrientation: link
instructions:
- label: Overview
path: ./instructions/overview.md
- label: Create Database
path: ./instructions/create-database.md

exports:
- downloadButtonText: Download Connection String
fileFormat: txt
templatePath: ./exports/connection-string.liquid
templateLang: liquid
- downloadButtonText: Download .env
fileFormat: env
templatePath: ./exports/dotenv.liquid
templateLang: liquid

schema:
title: PostgreSQL Database
description: A PostgreSQL database connection resource
type: object
additionalProperties: false
required:
- infrastructure
- authentication
properties:
infrastructure:
title: Infrastructure
type: object
required:
- arn
properties:
arn:
title: ARN
type: string
authentication:
title: Authentication
type: object
required:
- hostname
- port
- username
- password
- database
properties:
hostname:
title: Hostname
type: string
port:
title: Port
type: integer
default: 5432
username:
title: Username
type: string
password:
title: Password
type: string
$md.sensitive: true
database:
title: Database Name
type: string
iam:
title: IAM
type: object
patternProperties:
"^[a-z_]+$":
type: object
properties:
role:
type: string
scope:
type: string

Instruction File Example​

./instructions/overview.md:

markdown
# PostgreSQL Database Setup

This resource represents a PostgreSQL database connection.

## Prerequisites

- Access to your cloud provider's RDS or database service
- Network connectivity to the database endpoint
- Database credentials with appropriate permissions

Export Template Example​

A template reads the resource's payload as artifact.payload and its ID as artifact.id. It renders the unmasked payload.

./exports/connection-string.liquid:

liquid
{%- assign auth = artifact.payload.authentication -%}
postgresql://{{ auth.username }}:{{ auth.password }}@{{ auth.hostname }}:{{ auth.port }}/{{ auth.database }}

./exports/dotenv.liquid:

liquid
DATABASE_HOST={{ artifact.payload.authentication.hostname }}
DATABASE_PORT={{ artifact.payload.authentication.port }}
DATABASE_USER={{ artifact.payload.authentication.username }}
DATABASE_PASSWORD={{ artifact.payload.authentication.password }}
DATABASE_NAME={{ artifact.payload.authentication.database }}

Publishing​

A resource type is published to a repository in your organization's catalog, the same way a bundle is.

shell
# Create the repository once
mass resource-type create aws-vpc

# Publish the version in massdriver.yaml
mass resource-type publish ./aws-vpc

# Pull a published version back down
mass resource-type pull aws-vpc@2.1.0

mass resource-type publish takes a directory containing a massdriver.yaml, or the massdriver.yaml itself, and defaults to the current directory.

A published version holds the massdriver.yaml, the readme, the changelog, the icon, and the instruction and export files that massdriver.yaml references. Nothing else in the directory is published.

A published version cannot be overwritten, so anything pinned to it always resolves to the same content.

Versions and release channels​

Resource types use the same version model as bundles: semantic versions, release channels, and development releases. A bundle names the versions it accepts in its dependencies and resources blocks, and Massdriver resolves the range at deploy time. See Version Resolution.

Access to a resource type repository is controlled by the repo:view and repo:pull policy actions. Resource type repositories cannot be shared with grants.

Development releases​

A development release tests a resource type change against real bundles before the stable release. It works like a bundle development release.

shell
mass resource-type publish --development ./aws-vpc

With version: 2.2.0 in massdriver.yaml, this publishes 2.2.0-dev.<timestamp>, for example 2.2.0-dev.20261110T153000Z. Each run publishes a new development release. When the change is ready, publish without --development to release 2.2.0. A development release cannot be published for a version that already exists.

A development release is skipped by stable ranges. Bundles only pick it up when their dependencies or resources entry opts in with an exact version or a +dev range. See Version Resolution: Development releases.

Referenced files must exist​

ui.instructions[].path and exports[].templatePath point at files. A path that does not exist, or that resolves outside the resource type's directory, fails the publish.

Publishing a raw JSON schema is deprecated​

mass resource-type publish still accepts a raw JSON or YAML schema file, the format that predates massdriver.yaml, and prints a deprecation warning. That path will be removed in a future release.

A raw schema carries no version of its own. It is stored as the resource type's unversioned 0.0.0 document, cannot take part in versioning, and cannot be pulled back down.

mass resource-type convert migrates one:

shell
mass resource-type convert ./my-resource-type.json

It writes a massdriver.yaml next to the schema and moves inlined instruction and export content into referenced files. It writes a placeholder version. Set a real version before you publish.

Resource types that existed before this format were migrated in place and keep working.

Referencing in Bundles​

Name the resource type and the versions you accept in a bundle's massdriver.yaml:

yaml
# What the bundle consumes
dependencies:
database:
# Omit the org prefix for resource types in your own organization
resource_type: postgres-database@~2
required: true

# What the bundle produces for other bundles to consume
resources:
database:
resource_type: postgres-database@~2
required: true

Both accept an exact version or a range. See Version Resolution for the accepted range forms.

Field Reference​

FieldRequiredDescription
nameYes^[a-z0-9-]{3,100}$
versionTo publishSemantic version, published as the repository's tag
labelNoDisplay name in the UI
iconNoURL to icon image
ui.connectionOrientationNo"link" or "environmentDefault"
ui.environmentDefaultGroupNoGroups the type in an environment's defaults panel; "credentials" marks cloud credential types
ui.instructionsNoArray of onboarding steps
ui.instructions[].labelYesStep title
ui.instructions[].pathYesPath to markdown file
ui.schemaNoRJSF uiSchema for the import form
exportsNoArray of export templates
exports[].downloadButtonTextYesDownload button label
exports[].fileFormatYesFile extension, lowercase letters and digits
exports[].templatePathYesPath to template file
exports[].templateLangYesTemplate language (liquid)
schemaYesJSON Schema definition

See Also​