Skip to content

DigitalOcean.Certificates reference

Source: packages/digitalocean/src/Certificate.ts

A TLS certificate for DigitalOcean load balancers and CDN endpoints, either issued and renewed by Let’s Encrypt or one you upload. A certificate cannot change, so every change replaces it, creating the new one before deleting the old one.

Alchemy owns a certificate whose name it generated or whose id it recorded. A certificate that already has the chosen name is Unowned and needs --adopt.

const domain = yield* DigitalOcean.Domain("shop", { name: "shop.example.com" });
const cert = yield* DigitalOcean.Certificate("shop-cert", {
type: "lets_encrypt",
dnsNames: [domain.name],
});
const cert = yield* DigitalOcean.Certificate("shop-cert", {
type: "custom",
privateKey: yield* Config.Redacted("TLS_PRIVATE_KEY"),
leafCertificate: yield* Config.string("TLS_CERTIFICATE"),
certificateChain: yield* Config.string("TLS_CHAIN"),
});