feat: organize all services into separate stacks by dependency
This commit is contained in:
36
utils/1password-secret/index.ts
Normal file
36
utils/1password-secret/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Construct } from "constructs";
|
||||
import { Manifest } from "@cdktf/provider-kubernetes/lib/manifest";
|
||||
import { KubernetesProvider } from "@cdktf/provider-kubernetes/lib/provider";
|
||||
|
||||
type SecretOptions = {
|
||||
provider: KubernetesProvider;
|
||||
namespace: string;
|
||||
name: string;
|
||||
itemPath: string;
|
||||
};
|
||||
|
||||
export class OnePasswordSecret extends Construct {
|
||||
constructor(scope: Construct, id: string, options: SecretOptions) {
|
||||
super(scope, id);
|
||||
|
||||
const { itemPath, name, namespace, provider } = options;
|
||||
|
||||
new Manifest(this, name, {
|
||||
provider,
|
||||
manifest: {
|
||||
apiVersion: "onepassword.com/v1",
|
||||
kind: "OnePasswordItem",
|
||||
metadata: {
|
||||
name,
|
||||
namespace,
|
||||
annotations: {
|
||||
"operator.1password.io/auto-restart": "true",
|
||||
},
|
||||
},
|
||||
spec: {
|
||||
itemPath,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user