Terraform cdktf python conditions always return false

I’m trying to output values based on variables.
in my use case i was trying to output values if a input has certain values , here is example :

if test.string_value=="TNTN":
    TerraformOutput(self, "alb_dns",
    TerraformOutput(self, "instance_id",


I am expecting that if test variable is equal to “TNTN” alb_dns and instance_type are outputted .Instead of that , always condition return false then the block is skipped .
Note that the test variable is passed through env variables (TF_VAR_test=TNTN).

Hi @ramzi-af :wave:

Terraform variables are tokens (docs) which means that their values will only be available at Terraform plan / apply time.

Out of curiosity: What is the reason you are trying to create those outputs conditionally?

– Ansgar

@ansgarm Thank you . i want just to experiment with cdktf .