Kemal Erbakirci
02/18/2023, 9:34 AM@JsModule("cdktf")
@JsNonModule
open external class App()
fun main() {
val app = App()
println(app)
}
and here is the error message:
val app = App()
^
TypeError: App is not a constructor
any help will be highly appreciatedBig Chungus
02/18/2023, 9:45 AMKemal Erbakirci
02/18/2023, 9:47 AMBig Chungus
02/18/2023, 9:48 AMKemal Erbakirci
02/18/2023, 9:49 AMimport constructs.Construct
@JsModule("constructs")
@JsNonModule
external object constructs {
open class Construct
}
@JsModule("cdktf")
@JsNonModule
external object cdktf {
class App : Construct {
fun synth(): Unit
}
open class TerraformStack(scope: Construct, id: String) : Construct
class TerraformVariable(app: Construct, id: String, function: () -> Unit)
}
//////////////
class MyStack(scope: Construct, id: String) : cdktf.TerraformStack(scope, id) {
init {
cdktf.TerraformVariable(this, "my_var") {}
}
}
fun main() {
val app = <http://cdktf.App|cdktf.App>()
MyStack(app, "ctd-infra")
app.synth();
}
and now I get this error:
class MyStack(scope: Construct, id: String) : cdktf.TerraformStack(scope, id) {
^
ReferenceError: TerraformStack is not defined
any ideas?Big Chungus
02/18/2023, 6:16 PMKemal Erbakirci
02/20/2023, 8:32 AMBig Chungus
02/21/2023, 12:22 AMKemal Erbakirci
02/21/2023, 6:25 PMBig Chungus
02/21/2023, 6:34 PMKemal Erbakirci
02/21/2023, 6:36 PMkotlin
😄Big Chungus
02/21/2023, 6:37 PM