[Python] Conditions in Terraform cdktf Python

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to experiment with Terraform cdktf Python:

    My mission consists of how really a condition is working with cdktf. So I tried to create outputs based on variable values, and it seems like the condition always returns 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 are outputted when the condition is true. Note that test variable is passed through environment variables (TF_VAR_test=TNTN).

    Continue reading...

Compartilhe esta Página