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

cloudflare_rate_limit is incorrectly being generated for zone_id and timeout #494

Open
2 tasks done
wesleykirkland opened this issue Nov 28, 2022 · 0 comments
Open
2 tasks done

Comments

@wesleykirkland
Copy link

Confirmation

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

cf-terraforming version

0.8.4

Expected outcome

Side note, 0.8.4 is the latest available via brew.

When generate cloudflare_rate_limit resources, wherever the api returns a timeout = 0 value this is incorrectly generated in the code. As described here the timeout is optional. The Cloudflare API is returning 0 for something that is optional, the generating provider should recongize this and omit it from generating it in the action block.

In addition it does not add the zone_id parameter.

Actual outcome

resource "cloudflare_rate_limit" "terraform_managed_resource_REDACTED" {
description = "description"
disabled = true
period = 60
threshold = 5
action {
mode = "challenge"
timeout = 0
}
match {
request {
methods = ["ALL"]
schemes = ["ALL"]
url_pattern = "mywebsite.com*"
}
response {
headers = [
{
name = "Cf-Cache-Status"
op = "ne"
value = "HIT"
}
]
origin_traffic = true
}
}
}

Steps to reproduce

Run cf-terraforming cf-terraforming generate --resource-type "cloudflare_rate_limit" --zone "zoneid" --account "accountid" > cf_rate_limit.tf

References

This is a half duplicate of #362 which is open with no feedback on a much older version and this issue also mentions the zone_id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant