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

Module dependency #7

Closed
pessoa opened this issue Feb 11, 2018 · 1 comment
Closed

Module dependency #7

pessoa opened this issue Feb 11, 2018 · 1 comment

Comments

@pessoa
Copy link

pessoa commented Feb 11, 2018

If we make this module (in VPC mode) use subnet_ids:

  vpc_options   = {
    security_group_ids = ["${aws_security_group.es_sg.id}"]
    subnet_ids        = ["${module.vpc.private_subnets}"]
  }

from another module (eg. https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws) it will fail with:

* module.elastic_search.data.aws_iam_policy_document.es_vpc_management_access: data.aws_iam_policy_document.es_vpc_management_access: value of 'count' cannot be computed
* module.elastic_search.data.aws_iam_policy_document.es_management_access: data.aws_iam_policy_document.es_management_access: value of 'count' cannot be computed

I believe this is caused because there's no way to tell terraform about module dependencies: hashicorp/terraform#10462

So far I have not been able to workaround it. Not even by using something like hashicorp/terraform#1178 (comment)

@hakamadare
Copy link
Contributor

hm. i’ve seen this too, and have worked around it with something like this:

data “aws_subnet_ids” “es” {
  vpc_id = “${module.vpc.vpc_id}”

  tags {
    es = “True”
  }
}

iirc that will eventually produce a working configuration, provided you put the appropriate tag on the subnets in the other module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants