dubiety / terraform-aws-elasticsearch-cloudwatch-sns-alarms

terraform module that configures important alarms for AWS elasticsearch and send them to SNS topic
Apache License 2.0
30 stars 45 forks source link

Error: Invalid count argument #11

Closed martingehrke closed 3 years ago

martingehrke commented 3 years ago
terraform --version
Terraform v0.15.0
on darwin_amd64
+ provider registry.terraform.io/hashicorp/archive v2.1.0
+ provider registry.terraform.io/hashicorp/aws v3.37.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0
+ provider registry.terraform.io/hashicorp/tls v3.1.0
_
x Error: Invalid count argument
x
x   on .terraform/modules/es_alarms/main.tf line 5, in resource "aws_sns_topic" "default_prefix":
x    5:   count       = var.sns_topic == "" && var.create_sns_topic == true ? 1 : 0
x
x 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.
_
_
x Error: Invalid count argument
x
x   on .terraform/modules/es_alarms/main.tf line 11, in resource "aws_sns_topic" "default":
x   11:   count = var.sns_topic != "" && var.create_sns_topic == true ? 1 : 0
x
x 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.