│ Error: Invalid count argument
│
│ on .terraform/modules/opennext/modules/opennext-cloudfront/waf.tf line 125, in resource "aws_wafv2_web_acl_logging_configuration" "waf_logging":
│ 125: count = var.waf_logging_configuration == null || try(aws_wafv2_web_acl.cloudfront_waf[0], null) == null ? 0 : 1
│
│ 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.
Expected Behavior
No error
Steps To Reproduce
Run the module with the following settings
module "opennext" {
source = "nhs-england-tools/opennext/aws"
version = "1.0.3" # Use the latest release from https://github.com/nhs-england-tools/terraform-aws-opennext/releases
prefix = "ease-ealing-opennext" # Prefix for all created resources
opennext_build_path = "../../../.open-next" # Path to your .open-next folder
hosted_zone_id = aws_route53_zone.main.zone_id # The Route53 hosted zone ID for your domain name
cloudfront = {
aliases = [local.domain_name] # Your domain name
acm_certificate_arn = aws_acm_certificate.main.arn # The ACM (SSL) certificate for your domain
waf_logging_configuration = null
}
}
Output
No response
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Sensitive Information Declaration
[X] I confirm that neither PII/PID nor sensitive data are included in this form
Is there an existing issue for this?
Current Behavior
Error on initial deploy
│ Error: Invalid count argument │ │ on .terraform/modules/opennext/modules/opennext-cloudfront/waf.tf line 125, in resource "aws_wafv2_web_acl_logging_configuration" "waf_logging": │ 125: count = var.waf_logging_configuration == null || try(aws_wafv2_web_acl.cloudfront_waf[0], null) == null ? 0 : 1 │ │ 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.
Expected Behavior
No error
Steps To Reproduce
Run the module with the following settings
Output
No response
Code of Conduct
Sensitive Information Declaration