cf-terraforming icon indicating copy to clipboard operation
cf-terraforming copied to clipboard

Inappropriate value for attribute "exclude" for generated cloudflare_page_rule

Open n0madic opened this issue 4 years ago • 1 comments

Confirmation

  • [X] My issue isn't already found on the issue tracker.
  • [X] I have replicated my issue using the latest version of the library and it is still present.

cf-terraforming version

cf-terraforming v0.3.0

Expected outcome

resource "cloudflare_page_rule" "terraform_managed_resource_314693aa6ff5dd6865e71e7ef40acf88" {
  priority = 3
  status = "active"
  target = "example.com/*"
  zone_id = "bfbff7ed1cc423c96e1a42c7ba2cf514"
  actions {
    cache_key_fields {
      host {
        resolved = false
      }
      query_string {
        exclude = ["*"]
        ignore = true
      }
      user {
        device_type = false
        geo = false
        lang = false
      }
    }
    browser_cache_ttl = 0
    host_header_override = "example.net"
  }
}

Actual outcome

resource "cloudflare_page_rule" "terraform_managed_resource_314693aa6ff5dd6865e71e7ef40acf88" {
  priority = 3
  status = "active"
  target = "example.com/*"
  zone_id = "bfbff7ed1cc423c96e1a42c7ba2cf514"
  actions {
    cache_key_fields {
      host {
        resolved = false
      }
      query_string {
        exclude = "*"
        ignore = true
      }
      user {
        device_type = false
        geo = false
        lang = false
      }
    }
    browser_cache_ttl = 0
    host_header_override = "example.net"
  }
}

Steps to reproduce

  1. cf-terraforming generate --zone <zone_id> --resource-type cloudflare_page_rule > cloudflare_page_rule.tf
  2. terraform plan

References

For cloudflare_page_rule, the type for the "exclude" attribute is incorrectly exported

terraform plan output:

│ Error: Incorrect attribute value type
│
│   on cloudflare_page_rule.tf line 143, in resource "cloudflare_page_rule" "terraform_managed_resource_314693aa6ff5dd6865e71e7ef40acf88":
│  143:         exclude = "*"
│
│ Inappropriate value for attribute "exclude": set of string required.

It should be an array (doc)

  exclude = ["*"]

P.S. Same with the last master

n0madic avatar Aug 19 '21 15:08 n0madic

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 02 '22 08:03 stale[bot]