Skip to content
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

Route table association errors: element() may not be used with an empty list #46

Closed
woodland-appcolony opened this issue Dec 11, 2017 · 4 comments · Fixed by #47
Closed

Comments

@woodland-appcolony
Copy link

woodland-appcolony commented Dec 11, 2017

Getting this error when attempting to use this module:

Error: Error running plan: 2 error(s) occurred:

* module.vpc.aws_route_table_association.database: 3 error(s) occurred:

* module.vpc.aws_route_table_association.database[1]: element: element() may not be used with an empty list in:

${element(aws_route_table.private.*.id, count.index)}
* module.vpc.aws_route_table_association.database[2]: element: element() may not be used with an empty list in:

${element(aws_route_table.private.*.id, count.index)}
* module.vpc.aws_route_table_association.database[0]: element: element() may not be used with an empty list in:

${element(aws_route_table.private.*.id, count.index)}
* module.vpc.aws_route_table_association.elasticache: 3 error(s) occurred:

* module.vpc.aws_route_table_association.elasticache[2]: element: element() may not be used with an empty list in:

${element(aws_route_table.private.*.id, count.index)}
* module.vpc.aws_route_table_association.elasticache[1]: element: element() may not be used with an empty list in:

${element(aws_route_table.private.*.id, count.index)}
* module.vpc.aws_route_table_association.elasticache[0]: element: element() may not be used with an empty list in:

${element(aws_route_table.private.*.id, count.index)}

Here is the tf file

module "vpc" {
  source = "terraform-aws-modules/vpc/aws"

  name = "prod-vpc"

  cidr = "10.0.0.0/16"

  azs                 = ["us-west-2a", "us-west-2b", "us-west-2c"]
  public_subnets      = ["10.0.0.0/22", "10.0.4.0/22", "10.0.8.0/22"]
  database_subnets    = ["10.0.128.0/24", "10.0.129.0/24", "10.0.130.0/24"]
  elasticache_subnets = ["10.0.131.0/24", "10.0.132.0/24", "10.0.133.0/24"]

  enable_dns_support   = true
  enable_dns_hostnames = true
  enable_nat_gateway   = false

  tags = "${local.common_tags}"
}

Module version 1.10.0

Terraform versions

Terraform v0.11.1
+ provider.aws v1.5.0
@antonbabenko
Copy link
Member

Another unusual use case - no private subnets. I will make a PR in a few minutes (hopefully it will work for other people as well).

@antonbabenko
Copy link
Member

v1.11.0 has been released. Give it a try.

@woodland-appcolony
Copy link
Author

@antonbabenko That did the trick; thank you for such a speedy fix!

@github-actions
Copy link

github-actions bot commented Nov 6, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants