Deploy an Application
Once an application bundle is published, add it to a project, link and configure it in the UI, and deploy it from the UI or the CLI. You can deploy any application in your organization that you have access to.
To finish this guide you need:
- A cloud account (AWS in this guide)
- A domain name registered with your cloud
- An access token for the Mass CLI. See Service Accounts.
Import a cloud credential​
Log into Massdriver.
A cloud credential is a resource, like a database or a VPC. A cloud is enabled by publishing a resource type for its credential, such as aws-iam-role for AWS or an Azure service principal for Azure. See Official Resource Types.
Open Resources in the sidebar and click Import Resource. Choose the resource type (AWS IAM Role in this guide). The Setup instructions pane shows how to create the role with the AWS CLI, the AWS Console, or a CloudFormation one-click. Paste the role ARN into the Configure pane and click Import Resource.
Create a project and environment​
Open Projects and create a project named Example. A project is a parity boundary: its environments, such as staging and production or us-west-1 and us-west-2, share one architecture.
Create an environment named Staging.
On the environment canvas, click Set environment defaults and set the credential you imported as the environment's default. Every instance in the environment that depends on that resource type receives it.
Add the infrastructure​
The application from Create an Application depends on a Kubernetes cluster and PostgreSQL. It inherits the cluster dependency from its runtime and declares the PostgreSQL dependency itself.
Open the bundles drawer and add:
aws-vpcaws-eks-clusteraws-rds-postgresoraws-aurora-serverless-postgres
Link them, then click each component, open Config options, pick a preset such as Development, and click Deploy.
Bundles that provide the same functionality produce the same resource types, so you can swap one for another. Here aws-rds-postgres, aws-aurora-serverless-postgres, or PostgreSQL running on Kubernetes can fill the application's PostgreSQL dependency.
Add and deploy the application​
When the infrastructure is deployed, add k8s-phoenix-chat-example and link it to the cluster and database.
Open its Config tab. The fields come from the runtime's params. Set the image repository to the public massdrivercloud/phoenix-chat-example image, then click Deploy.
Deploy from the CLI​
mass instance deploy takes the instance ID: <project>-<environment>-<component>. It is on the instance's Overview tab under Identifiers → Instance ID.

Add it to a CI/CD pipeline to deploy on each release:
export MASSDRIVER_ORGANIZATION_ID=example-org
export MASSDRIVER_API_KEY=md_xxxxxxxxxxxxxxxxxxxxxxxx
mass instance deploy example-staging-phoenixchat
Without --params or --patch, mass instance deploy reuses the configuration of the most recent deployment. See mass instance deploy.
Your organization ID is the path segment after /orgs/ in every Massdriver URL. In https://app.massdriver.cloud/orgs/sandbox/projects, it is sandbox.