Improvements to the cloudflare_waf_rule
resource
#552
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:package_id
: if I'm currently bulk-applying something and I already know the package ID, providing it allows to avoid 1 API call percloudflare_waf_rule
(which is used to list then find the package needed). If thepackage_id
is not provided, it will be determined as it was before.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.