C:\Testinfo\AWS_Dathub_Vora\AWS-EKS-cluster-Setup-master\AWS-EKS-cluster-Setup-master\EKS_Cluster>terraform plan
Error: Reference to "count" in non-counted context
on eks_cluster_cloudform_stack.tf line 24, in resource "aws_cloudformation_stack" "eks-worker-nodes":24: Subnets = aws_subnet.terraform[count.index].id
The "count" object can be used only in "resource" and "data" blocks, and onlywhen the "count" argument is set.
As the error says, you can only use count.index if the
resource/data block you are in has a "count" element, which your
example does not.
Are you just wanting the first subnet to be passed to the
parameter? If so replace it with [0] instead of [count.index]
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/792925a9-4a2d-4187-a3bd-8c5df844fe5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Stuart Clark