Search code examples
amazon-web-servicesamazon-cloudfrontterraform-provider-awsamazon-waf

AWS waf and cloudfront association doesn't show request data in the web ACL dashboard


I have previously configured the AWS waf and its corresponding web ACL manually in the AWS dashboard and then associated it with a Cloudfront distribution and it worked perfectly. Now that I have created the process in Terraform and associated it with the same distribution (manually associated it), I get no data of the sampled requests in the web ACL dashboard. I have waited for over 48 hours from when I associated the web ACL with the Cloudfront distribution.

Any ideas on what could be wrong?


Solution

  • From your Terraform code, you have to enable the sampled_requests_enabled attribute to have the sample data.

      visibility_config {
        cloudwatch_metrics_enabled = false
        metric_name                = "friendly-metric-name"
        sampled_requests_enabled   = true
      }
    

    References: