Files
2025-08-07 19:06:29 -04:00

39 lines
1.1 KiB
TypeScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {Construct} from "constructs";
import {App, TerraformStack} from "cdktf";
import {Org} from "./.gen/providers/zitadel/org";
import {parse} from "dotenv";
import { ZitadelProvider } from "./.gen/providers/zitadel/provider";
const config = parse("../.zitadel.env");
const configExpanded = {
zitadelKey: config.ZITADEL_MASTERKEY,
};
class MyStack extends TerraformStack {
constructor(scope: Construct, id: string) {
super(scope, id);
// 1⃣ Provider configuration
new ZitadelProvider(this, "zitadel", {
domain: "http://localhost", // your instance URL
port: "8080",
insecure: true, // set true for dev/self-signed
token: configExpanded.zitadelKey
// or serviceAccountId / key depending on the auth method you prefer
});
// 2⃣ Create an organisation
new Org(this, "demoOrg", {
name: "geoffs-makers-guild"
// optional: project_grant_role_assertion, default_language, etc.
});
}
}
const app = new App();
new MyStack(app, "zitadel-configurator");
app.synth();