Eks-getting-started fails terraform plan

I’m attempting to follow eks-getting-started as referenced from this Amazon document. I clone the git repo, change into the example directory, and run the plan command. It fails with the message

Error: subnet_ids: attribute supports 1 item as a minimum, config has 0 declared

  on eks-worker-nodes.tf line 41, in resource "aws_eks_node_group" "demo":
  41: resource "aws_eks_node_group" "demo" {

The line it doesn’t like is

 subnet_ids         = aws_subnet.demo[*].id

This is the Terraform-provided example. And it doesn’t work. I’m finding this a common occurrence.

Has anyone tried the example? Or might be able to point me in a useful direction for troubleshooting?

Thanks.