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

Initial deploy fails because of invalid count argument #16

Closed
3 tasks done
adam-carruthers opened this issue Nov 26, 2023 · 2 comments
Closed
3 tasks done

Initial deploy fails because of invalid count argument #16

adam-carruthers opened this issue Nov 26, 2023 · 2 comments
Labels
bug Something isn't working triage

Comments

@adam-carruthers
Copy link

Is there an existing issue for this?

  • I have searched the existing Issues

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

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

  • I agree to follow this project's Code of Conduct

Sensitive Information Declaration

  • I confirm that neither PII/PID nor sensitive data are included in this form
@trustyoo86
Copy link

It hasn't been resolved yet?

@Tomdango
Copy link
Collaborator

Closing as fixed in #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants