I’m trying to deploy a bastion conditional on bastion being enabled or bastion IP definition.
From terraform.tfvars:
bastion_ip = "1.2.3.4"
It fails terraform plan:
│ Error: Invalid count argument
│
│ on modules/platform/main.tf line 7, in resource "null_resource" "bastion":
│ 7: count = var.bastion_enabled || length(var.bastion_ip) > 0 ? 1 : 0
│
│ The "count" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first
│ apply only the resources that the count depends on.
I have set an IP so unsure why it must fail; can I work around this?
1 post - 1 participant