feat: CDKTF | migrate redis to cdktf

This commit is contained in:
2025-07-15 09:28:50 +05:00
parent 6f782e4775
commit 5475a25b94
3 changed files with 37 additions and 8 deletions

29
redis/index.ts Normal file
View File

@@ -0,0 +1,29 @@
import * as fs from "fs";
import { HelmProvider } from "@cdktf/provider-helm/lib/provider";
import { Release } from "@cdktf/provider-helm/lib/release";
import { Construct } from "constructs";
type RedisClusterOptions = {
provider: HelmProvider;
version: string;
name: string;
namespace: string;
};
export class RedisCluster extends Construct {
constructor(scope: Construct, id: string, options: RedisClusterOptions) {
super(scope, id);
new Release(this, id, {
...options,
repository: "https://charts.bitnami.com/bitnami",
chart: "redis",
createNamespace: true,
values: [
fs.readFileSync("helm/values/redis.values.yaml", {
encoding: "utf8",
}),
],
});
}
}