feat: 1PasswordOperator | add to k8s operators stack

This commit is contained in:
2025-11-22 23:20:15 +05:00
parent 65ed6ea664
commit b2fd9d100a

View File

@@ -0,0 +1,48 @@
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 OnePasswordOptions = {
provider: HelmProvider;
name: string;
};
export class OnePassword extends Construct {
constructor(scope: Construct, id: string, options: OnePasswordOptions) {
super(scope, id);
const { provider } = options;
new Release(this, "onepassword-operator", {
provider,
name: "onepassword-operator",
chart: "connect",
repository: "https://1password.github.io/connect-helm-charts/",
namespace: "1password",
createNamespace: true,
set: [
{
name: "operator.create",
value: "true",
},
],
setSensitive: [
{
name: "operator.token.value",
value: process.env.OP_CONNECT_TOKEN!,
},
{
name: "connect.credentials_base64",
value: btoa(
fs.readFileSync(
path.join(__dirname, "1password-credentials.json"),
"utf-8",
),
),
},
],
});
}
}