Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
page_rules: Swap to completely replacing rules (#338)
* page_rules: Swap to completely replacing rules For a long time, this provider relied on sending page rules using cloudflare-go's `ChangePageRule` which was documentated to allow inline updates using a PATCH request. Until recently, this wasn't the case and it actually mimicked the PUT alternative (`UpdatePageRule`) where it attempted to replace the entire rule. This was fixed[1] and while you could now send inline updates to actions, there wasn't a way to remove them once they were there. To address this, I've swapped back to `UpdatePageRule` (the PUT request) which will resolve the aforementioned issue with removing rules but it does re-introduce the caveat of not being able to manage actions that require a Solutions Engineer. This means, you can't manage them using this endpoint as you won't have permission to apply them. This extends to page rule changes like re-ordering or updating other actions which are in the same rule. If you hit this use case, you should can move the cache key into Cloudflare Workers. This commit backs out most of the changes from c1799f4 as they are no longer required for differentiating the actions to send. [1]: https://github.com/terraform-providers/terraform-provider-cloudflare/pull/176#issuecomment-452906541 * Check actions for existence and change status Updates the `transformToCloudflarePageRuleAction` functionality to perform checks using `HasChange` to determine whether or not the value should be sent or `nil`.
- Loading branch information