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

Page rule zone attribute change to trigger new resource #183

Conversation

jacobbednarz
Copy link
Member

#180 raised an issue whereby using a cloudflare_page_rule resource
with a single resource identifier but multiple variables to change the
zone attribute would attempt to update the page rule in place instead
of re-creating it (see the attached issue for full reproduction
steps). This isn't good as the target attribute needs to contain
references to the zone in order to be successfully updated.

To fix this, the schema details for zone has been updated to force a
new resource on change. On the surface this change is fine however I can
see a couple of scenarios where a DiffSuppressFunc that checks the
host against the stored state file host might be needed in order to not
create and delete unnecessarily and instead only create a new resource
if the hosts are different.

Fixes #180

cloudflare#180 raised an issue whereby using a `cloudflare_page_rule` resource
with a single resource identifier but multiple variables to change the
`zone` attribute would attempt to update the page rule in place instead
of re-creating it (see the attached issue for full reproduction
steps). This isn't good as the `target` attribute needs to contain
references to the `zone` in order to be successfully updated.

To fix this, the schema details for `zone` has been updated to force a
new resource on change. On the surface this change is fine however I can
see a couple of scenarios where a `DiffSuppressFunc` that checks the
host against the stored state file host might be needed in order to not
create and delete unnecessarily and instead only create a new resource
if the hosts are different.

Fixes cloudflare#180
Creates a new method `testAccPreCheckAltDomain` to fail hard in the
event the required environment variables aren't defined that are needed
in order to successfully run these tests.
@ghost ghost added size/S and removed size/XS labels Dec 20, 2018
@patryk patryk merged commit a90979b into cloudflare:master Jan 7, 2019
@patryk
Copy link
Contributor

patryk commented Jan 7, 2019

Thanks!

@jacobbednarz jacobbednarz deleted the page-rule-zone-change-should-trigger-new-rule branch January 7, 2019 20:45
boekkooi-lengoo pushed a commit to boekkooi-lengoo/terraform-provider-cloudflare that referenced this pull request Feb 28, 2022
* Add support for Virtual DNS user analytics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing a Page Rule's zone doesn't force recreation
2 participants