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

Improvements to the cloudflare_waf_rule resource #552

Merged

Conversation

XaF
Copy link
Contributor

@XaF XaF commented Dec 5, 2019

As part of the setup we are currently doing, I required to be able to grab the Group ID in which a rule is. The data source I wrote a few weeks back provides that parameter, but when I'm using the resource, it is not available. This thus includes a fix for that to provide the group_id parameter.

This also improves slightly the resource, inspired from things I did in the cloudflare_waf_group resource:

  • Allow to provide the package_id: if I'm currently bulk-applying something and I already know the package ID, providing it allows to avoid 1 API call per cloudflare_waf_rule (which is used to list then find the package needed). If the package_id is not provided, it will be determined as it was before.
  • Call resourceCloudflareWAFRuleRead(d, meta) on Create and Update; this is a recommendation from terraform that was not applied in that resource, but now is.

None of those changes are breaking.

@ghost ghost added size/M kind/documentation Categorizes issue or PR as related to documentation. labels Dec 5, 2019
@jacobbednarz jacobbednarz merged commit 90945c9 into cloudflare:master Dec 18, 2019
@jacobbednarz
Copy link
Member

Thanks @XaF !

@XaF XaF deleted the xaf/resource_waf_rule_improvements branch December 18, 2019 22:06
boekkooi-lengoo pushed a commit to boekkooi-lengoo/terraform-provider-cloudflare that referenced this pull request Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants