Deploying Your First Bundle
This guide publishes the catalog's network bundle and the virtual-network resource type it produces, then configures and deploys the bundle from the Massdriver UI.
You will learn:
- How resource types and bundles are published to repositories in your organization
- How a bundle's
paramsschema becomes a validated form - How presets and immutable fields work
- How to deploy an instance and follow its logs
Prerequisites​
Complete the prerequisites: a Massdriver account and the Mass CLI configured for your organization.
Step 1: Clone the catalog​
git clone https://github.com/massdriver-cloud/massdriver-catalog.git
cd massdriver-catalog
The network bundle is in bundles/network:
massdriver.yaml: the bundle's name, version, params, dependencies, resources, and stepssrc/: the OpenTofu module. It creates arandom_petand emits avirtual-networkresource withmassdriver_resource.operator.md: the runbook shown in the Massdriver UI
Step 2: Publish the resource type​
The network bundle produces a virtual-network resource, so publish that resource type first. Each resource type and each bundle is published to its own repository in your organization's catalog. Create the repository once, then publish versions to it:
mass resource-type create virtual-network
mass resource-type publish resource-types/virtual-network
Step 3: Publish the bundle​
mass bundle create network
mass bundle publish bundles/network
mass bundle publish builds and lints the bundle, then publishes the version in its massdriver.yaml. A published version is immutable. The catalog's bundles use version 0.0.0, which can be republished while you experiment.
make publish-all in the catalog creates the repositories and publishes every resource type and bundle in one step.
Step 4: Add the bundle to a project​
- Log into Massdriver.
- Open Projects and create a project, then create an environment in it, such as
staging. - Open the environment's canvas and click the bundle icon (Open bundles).
- Under My bundles, find
networkand drag it onto the canvas. - Enter a Component Name and a Component ID, then click Add. The component ID becomes part of every instance ID, for example
<project>-staging-<component>.
Step 5: Configure the instance​
Click the component on the canvas to open the instance panel, then open the Config tab. The form is generated from the params schema in bundles/network/massdriver.yaml.
Presets​
Open Config options and choose a preset under Fill in form with preset data...:
- Small (/24 dev)
- Medium (staging)
- Large (production multi-AZ)
Each preset is an entry in params.examples. Its __name is the label, and its other keys fill the form.
Validation​
- Network CIDR has a
patternand a custommessage. Enter10.0.0.0and the form shows "Must be a valid IPv4 CIDR block, like 10.0.0.0/16." - Subnets is an array with
minItems: 1andmaxItems: 12. You can add, remove, and reorder items. - Flow Log Retention (days) allows 1 to 365.
Immutable fields​
Network CIDR sets $md.immutable: true. After the first deployment the field cannot be changed, because changing a network's address range replaces the network.
See Massdriver Annotations for $md.immutable and the other annotations.
Step 6: Deploy​
Click Deploy. Massdriver starts a deployment and opens its logs in a drawer.
When the deployment completes, open the Resources tab. It lists the virtual-network resource the bundle produced. Click Show resource data to see its payload.
The History tab lists every deployment of the instance, with its logs.
Next​
Connecting Bundles links a PostgreSQL bundle to this network.