VladRassokhin / intellij-hcl

HCL language support for IntelliJ platform based IDEs
Apache License 2.0
244 stars 47 forks source link

aws_cloudfront_distribution - forwarded_values validation needs to account for the cache_policy_id value #350

Closed omriKaltura closed 3 years ago

omriKaltura commented 3 years ago

Prerequisites

Installation details

Terraform Configuration Files

resource "aws_cloudfront_distribution" "example" {
  ...
  default_cache_behavior {
    allowed_methods  = ["GET","HEAD"]
    cached_methods   = ["GET", "HEAD"]
    target_origin_id = "anS3Bucket"
    cache_policy_id = data.aws_cloudfront_cache_policy.CachingOptimized.id

    viewer_protocol_policy = "redirect-to-https"
  }
  ...
}

Exception

Missing required properties: forwarded_values

Expected Behavior

when cache_policy_id field is configured under the default_cache_behavior, the forwarded_values block is not required by AWS

Actual Behavior

a warning is shown on the IDE

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. add cache_policy_id without the forwarded_values block
VladRassokhin commented 3 years ago

Fixed in 0.7.12