You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NB: network_plugin is set to kubenet which does not require the other variables to be set.
Debug Output
Crash Output
Error: Invalid function argument
on aks.tf line 61, in resource "azurerm_kubernetes_cluster" "aksqse":
61: service_cidr = "${length(var.service_cidr) > 1 ? var.service_cidr : null }"
|----------------
| var.service_cidr is null
Invalid value for "value" parameter: argument must not be null.
Expected Behavior
As the manual states:
a value that represents absence or omission. If you set an argument of a resource or module to null, Terraform behaves as though you had completely omitted it — it will use the argument's default value if it has one, or raise an error if the argument is mandatory. null is most useful in conditional expressions, so you can dynamically omit an argument if a condition isn't met.
Actual Behavior
Errors that the argument must not be null. This implies the value has been set as opposed to being unset.
Steps to Reproduce
Additional Context
occurs in azurerm_kubernetes_cluster however I do not think this is relevant.
References
The text was updated successfully, but these errors were encountered:
The error message here is complaining that var.service_cidr is null, not that the final service_cidr value is null. The length function does not accept null values for its argument, and so it's failing here.
Some other approaches here would include:
Making the default value of var.service_cidr be an empty string rather than null, so that length(var.service_cidr) will return zero when it isn't set.
Using coalesce to provide a default string value to use if var.service_cidr is null.
Because Terraform is working as designed here, we're going to close this out. If you have any further questions, please feel free to start a topic on the community forum!
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.
ghost
locked and limited conversation to collaborators
Sep 12, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
NB: network_plugin is set to kubenet which does not require the other variables to be set.
Debug Output
Crash Output
Error: Invalid function argument
on aks.tf line 61, in resource "azurerm_kubernetes_cluster" "aksqse":
61: service_cidr = "${length(var.service_cidr) > 1 ? var.service_cidr : null }"
|----------------
| var.service_cidr is null
Invalid value for "value" parameter: argument must not be null.
Expected Behavior
As the manual states:
a value that represents absence or omission. If you set an argument of a resource or module to null, Terraform behaves as though you had completely omitted it — it will use the argument's default value if it has one, or raise an error if the argument is mandatory. null is most useful in conditional expressions, so you can dynamically omit an argument if a condition isn't met.
Actual Behavior
Errors that the argument must not be null. This implies the value has been set as opposed to being unset.
Steps to Reproduce
Additional Context
occurs in azurerm_kubernetes_cluster however I do not think this is relevant.
References
The text was updated successfully, but these errors were encountered: