-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Call to function "coalesce" failed: no non-null, non-empty-string arguments. local.tf file #402
Comments
Not quite sure what fix you are proposing but could you make a PR? |
FWIW this is happening for me too when infrastructure is not fully destroyed, due in part to #285. Probably not an option for most but I only am able to workaround it by deleting the local and remote state. |
I would not call this module problem... according to the docs this is how it should behave.
Again, problem with Terraform, not this module... |
I believe terraform 0.12 has actually changed the behavior of coalesce() when all the inputs are empty. Before v0.12, when all inputs were empty, an empty string was returned. Starting from v0.12, it is considered an error. Here's a terraform issue stating this. Unfortunately, terraform's own documentation on coalesce() doesn't say anything about this case. It only lists examples where a non-empty value is found. |
We just migrated to terraform 0.12 and are affected by this bug. Would it be possible to release 5.1.1 with this fix instead of having to wait for the next major release? |
@marcelloromani you can always use a commit ID like this: |
Hi @max-rocket-internet module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "c9986f5e01c785875cb1e9cfa21ba195ef1bbab7"
[...] gives this error:
I tried different ways of referring to the commit to no avail. |
try
|
Thanks @confiq that line worked: module "eks" {
source = "git::https://github.com/terraform-aws-modules/terraform-aws-eks.git?ref=c9986f5e01c785875cb1e9cfa21ba195ef1bbab7"
[...] I've just tested creating / destroy a cluster with that version and the coalesce() bug didn't appear. |
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. |
I have issues
I'm submitting a...
What is the current behavior?
All the resources are destroy, however scrips throw error line next one
Error: Error in function call
on .terraform/modules/eks/terraform-aws-modules-terraform-aws-eks-9c3d222/local.tf line 6, in locals:
6: cluster_security_group_id = coalesce(
7:
8:
9:
|----------------
| aws_security_group.cluster is empty tuple
| var.cluster_security_group_id is ""
Call to function "coalesce" failed: no non-null, non-empty-string arguments.
Error: Error in function call
on .terraform/modules/eks/terraform-aws-modules-terraform-aws-eks-9c3d222/local.tf line 22, in locals:
22: worker_security_group_id = coalesce(
23:
24:
25:
|----------------
| aws_security_group.workers is empty tuple
| var.worker_security_group_id is ""
Call to function "coalesce" failed: no non-null, non-empty-string arguments.
If this is a bug, how to reproduce? Please include a code sample if relevant.
terraform plan -out=apply.plan
terraform apply apply.plan
terraform plan -out=destroy.plan -destroy
What's the expected behavior?
terraform should not throw this error
Are you able to fix this problem and submit a PR? Link here if you have already.
yes, just next lines to both error functions
cluster_security_group_id = coalesce(
join("", aws_security_group.cluster.*.id),
var.cluster_security_group_id,
"aws-eks" <-- line that fixes
)
worker_security_group_id = coalesce(
join("", aws_security_group.workers.*.id),
var.worker_security_group_id,
"aws-eks" <-- line that fixes
)
Environment details
Any other relevant info
When i add those two lines, terraform does not throw error if I apply destroy plan
The text was updated successfully, but these errors were encountered: