Skip to content

DigitalOcean.Tags reference

Source: packages/digitalocean/src/Tag.ts

A DigitalOcean tag. A tag that already exists on the team is Unowned and needs --adopt. Droplets and volumes create the tags in their tags prop on their own; declare a Tag when something must exist before any resource carries it, such as a firewall or load balancer that targets every droplet with the tag. Destroying the tag removes it from every resource that carries it.

const web = yield* DigitalOcean.Tag("web", { name: "web" });
yield* DigitalOcean.Firewall("web-firewall", {
tags: [web.name],
inboundRules: [{ protocol: "tcp", ports: "443", addresses: ["0.0.0.0/0", "::/0"] }],
});
yield* DigitalOcean.Droplet("app", {
region: "sfo3",
size: "s-1vcpu-1gb",
image: "ubuntu-24-04-x64",
tags: [web.name],
});