Hello,
I am new to CDKTF, currently we build everything using terraform. But look into use a new method: CDKTF to build on top layer. (logic layer, data layer…)
I have this data module, it will be called by network module:
metadata = TerraformHclModule(self, "metadata",
source="git::https://org@dev.azure.com/org/project/_git/data//customer",
variables={
"customer_abbrev": client_abbrev
})
network = TerraformHclModule(self, "network",
source="git::https://org@dev.azure.com/org/project/_git/TFModule//customer_vnet",
variables={
"client_abbrev": "abc"
"client_id": "abc",
"environment": "prod",
"metadata": metadata, # Here gives me error, from the metadata module.
})
### in terraform (https://org@dev.azure.com/org/project/_git/TFModule//customer_vnet)I have this metadata as a variable:
variable "dmz_metadata" {}
I got error of…
[ERROR] default - File "/Users/**/.local/share/virtualenvs/prod_cdktf-ASCbhU_m/lib/python3.11/site-packages/jsii/_kernel/providers/process.py", line 342, in send
raise RuntimeError(resp.error) from JavaScriptError(resp.stack)
RuntimeError: Error: Trying to 'resolve()' a Construct at '/module/network/metadata/node'.
This often means an unintended cyclic dependency in your construct tree, leading to the resolution stuck in an infinite loop that fails....
So I am wondering where did I do wrong?
I have to use the module to call the existing Terraform code, can’t re-created all resources by using CDKTF, so only this top layer, we will write the CDKTF.