Reputation: 13
I am trying to experiment with terraform cdktf python :
my mission consists of how really condition is working with cdktf.
So i tried to create outputs based on variable values and it seems like the condition always return false here is an example :
if test.string_value=="TNTN":
TerraformOutput(self, "alb_dns",
value=web_server_alb.dns_name
)
TerraformOutput(self, "instance_id",
value=instance_type
)
TerraformOutput(self, "test", value=test)
And i'm expecting that alb_dns, instance_type and product is outputted when the condition is true. Note that test variable is passed throw env variables (TF_VAR_test=TNTN)
Upvotes: 0
Views: 617
Reputation: 11921
CDKTF does not provide any values of e.g. resources at runtime, but instead uses Tokens. Therefore you can not build conditionals on runtime values, you can only have conditionals on things known at compile time.
Upvotes: 0