-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
35 lines (28 loc) · 933 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { App, TerraformStack } from 'cdktf';
import * as configs from './configs';
import { MyStack } from './stack';
class CdktfVsphereApp extends App {
private readonly _stack: TerraformStack;
constructor() {
super();
this._stack = new MyStack(this, 'cdktf-vsphere', {
user: configs.userConfigs.username,
password: configs.userConfigs.password,
datacenter: configs.labEnvInfo.datacenter,
datastoreCluster: configs.labEnvInfo.datastoreCluster,
network: configs.labEnvInfo.network,
rp_name: configs.userConfigs.resourcePool,
template: configs.userConfigs.template,
vm_name: configs.userConfigs.VMName,
disks: configs.userConfigs.disks,
cdktf_options: {
tfcloud_workspace: configs.userConfigs.tfcloudWorkspace,
},
});
}
public getStack(): TerraformStack {
return this._stack;
}
}
const app = new CdktfVsphereApp();
app.synth();