-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional expression assigned to local cannot be evaluated during plan #21450
Comments
I'm seeing this error as well but I can add a little extra circumstance ... For me, it seems to be about count in a resource block being derived from a local variable. A data block does not suffer the same problem but if you then pipe an output from that data block into a subsequent resource block it triggers again. Examples: local value direct to data count, does not error, works fine:
... but run that data block as an input to a resource block then it will error:
I'm using the same v0.12.0 as @woodrow.
|
count = "${local.test ? length(local.array) : 0}" doesn't work in 0.12 |
Doesn't work in 0.12.1 and is blocking any progress |
I'm on 0.12.4 and still have these issues: locals {
backendPoolType = split("/", var.backend_address_pool_id)[17]
)
} resource "azurerm_network_interface_backend_address_pool_association" "lb_backend_pool" {
network_interface_id = azurerm_network_interface.default.id
ip_configuration_name = "if-ipconf-${local.name}"
backend_address_pool_id = var.backend_address_pool_id
// only if we detected a Azure Load Balancer Resource ID in the variable
// backend_address_pool_id we're going to deploy this resource.
count = local.backendPoolType == "loadBalancers" ? 1 : 0
}
resource "azurerm_network_interface_application_gateway_backend_address_pool_association" "appgw_backend_pool" {
network_interface_id = azurerm_network_interface.default.id
ip_configuration_name = "if-ipconf-${local.name}"
backend_address_pool_id = var.backend_address_pool_id
// only if we detected a Azure Application Gateway Resource ID in the variable
// backend_address_pool_id we're going to deploy this resource.
count = local.backendPoolType == "applicationGateways" ? 1 : 0
} I'm getting the following errors:
@jbardin am I missing something? |
Guessing from the name, is |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
(I've also tried with
Terraform v0.12.1-dev
built from 2c176fd)Terraform Configuration Files
Root module:
iam_role
module:Expected Behavior
Plan should have been able to evaluate the local variable, and succeed in generating a plan creating two
aws_iam_role
resources and oneaws_iam_role_policy
resource.Actual Behavior
It appears that this
local.inline_policy
is(not yet known)
during the plan process, even though it (AFAICT) has all of the information needed to evaluate that expression.Steps to Reproduce
git clone [email protected]:woodrow/terraform-21450-reproducer.git && cd terraform-21450-reproducer/reproducer-0.12
terraform init
terraform plan
The text was updated successfully, but these errors were encountered: