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

Error: Invalid count argument #44

Open
ProxiBlue opened this issue Feb 19, 2020 · 0 comments
Open

Error: Invalid count argument #44

ProxiBlue opened this issue Feb 19, 2020 · 0 comments

Comments

@ProxiBlue
Copy link

Hello,

Any idea what is wrong? Worked once, destroyed once, then on any further retries:

11:55 $ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.template_file.installation_template: Refreshing state...
data.aws_availability_zones.all: Refreshing state...

------------------------------------------------------------------------

Error: Invalid count argument

  on .terraform/modules/es/main.tf line 30, in resource "aws_elasticsearch_domain" "es":
  30:   count = false == local.inside_vpc ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.


Error: Invalid count argument

  on .terraform/modules/es/main_vpc.tf line 31, in resource "aws_elasticsearch_domain" "es_vpc":
  31:   count = local.inside_vpc ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.

11:55 $ terraform --version
Terraform v0.12.20

  • provider.aws v2.49.0
  • provider.template v2.1.2
 module "es" {
  source  = "git::https://github.com/terraform-community-modules/tf_aws_elasticsearch.git?ref=v1.2.0"

  domain_name                    = "enjo-elasticsearch-domain"
  vpc_options                    = {
    security_group_ids = [ aws_security_group.rds.id ]
    subnet_ids         = aws_elb.magento.subnets
  }
  instance_count                 = 2
  ebs_volume_size                = 100
}

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

1 participant