Skip to content

DigitalOcean.Projects reference

Source: packages/digitalocean/src/Project.ts

A DigitalOcean Project: a folder that groups droplets, volumes, databases, domains and other resources in the control panel. Every resource belongs to one project; until you move it, that is the team’s default project. Move resources into a project with ProjectResources. Every prop updates in place.

Alchemy owns a project whose name it generated or whose id it recorded. A project that already has the chosen name is Unowned and needs --adopt. A project must be empty to be deleted.

const project = yield* DigitalOcean.Project("shop", {
name: "shop",
purpose: "Web Application",
environment: "Production",
});
const project = yield* DigitalOcean.Project("shop", { environment: "Production" });
const host = yield* DigitalOcean.Droplet("app", {
region: "sfo3",
size: "s-1vcpu-1gb",
image: "ubuntu-24-04-x64",
});
const data = yield* DigitalOcean.Volume("data", { region: "sfo3", sizeGigabytes: 10 });
yield* DigitalOcean.ProjectResources("shop-resources", {
projectId: project.projectId,
resources: [host.urn, data.urn],
});

Source: packages/digitalocean/src/ProjectResources.ts

Moves resources into a DigitalOcean Project. Every resource belongs to exactly one project, so “removing” a resource moves it back to the team’s default project. Destroying this resource moves all of its resources back to the default project; the resources themselves stay.

const project = yield* DigitalOcean.Project("shop", { environment: "Production" });
const host = yield* DigitalOcean.Droplet("app", {
region: "sfo3",
size: "s-1vcpu-1gb",
image: "ubuntu-24-04-x64",
});
const domain = yield* DigitalOcean.Domain("shop-domain", { name: "shop.example.com" });
yield* DigitalOcean.ProjectResources("shop-resources", {
projectId: project.projectId,
resources: [host.urn, domain.urn],
});