Skip to content

Certificate

Source: src/Hetzner/Certificate.ts

A Hetzner Cloud TLS Certificate. Upload a PEM (type: "uploaded", the default) or request a Let’s Encrypt Certificate for domains in Hetzner DNS (type: "managed").

name and labels update in place. Changing the type, the uploaded PEM/key, or the managed domain list replaces the Certificate.

Generated name

const cert = yield* Hetzner.Certificate("web", {
certificate: pem,
privateKey: key,
});

Explicit name and labels

const cert = yield* Hetzner.Certificate("web", {
name: "my-website-cert",
certificate: pem,
privateKey: key,
labels: { env: "prod" },
});
const cert = yield* Hetzner.Certificate("le", {
type: "managed",
domainNames: ["example.com", "www.example.com"],
});