Files
homelab/core-services/cert-manager/index.ts
2025-11-29 13:18:34 +05:00

34 lines
834 B
TypeScript

import * as fs from "fs";
import * as path from "path";
import { HelmProvider } from "@cdktf/provider-helm/lib/provider";
import { Release } from "@cdktf/provider-helm/lib/release";
import { Construct } from "constructs";
type CertManagerOptions = {
provider: HelmProvider;
name: string;
namespace: string;
};
export class CertManager extends Construct {
constructor(scope: Construct, id: string, options: CertManagerOptions) {
super(scope, id);
const { namespace, name, provider } = options;
new Release(this, id, {
provider,
name,
namespace,
repository: "https://charts.jetstack.io",
chart: "cert-manager",
createNamespace: true,
values: [
fs.readFileSync(path.join(__dirname, "values.yaml"), {
encoding: "utf8",
}),
],
});
}
}