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

PATCH endpoint for TLS subscriptions #370

Merged
merged 4 commits into from
Apr 6, 2021
Merged

PATCH endpoint for TLS subscriptions #370

merged 4 commits into from
Apr 6, 2021

Conversation

bengesoff
Copy link
Contributor

Adds support for the PATCH endpoint for updating TLS Subscriptions. Currently a Limited Availability feature so this won't work for all customers.

Similar to the force_destroy flag there is also a force_update flag which gets passed through to the API to enable making changes to production traffic. This is so you have to opt-in to this behaviour and take responsibility for the risk this may have. It is worth noting that there doesn't seem to be any case where not using this flag has any effect.

It appears the PATCH endpoint only supports updating the configuration_id, domains, or common_name so there is a CustomizeDiff present to trigger a recreation of the subscription if anything else changes. Therefore the PATCH endpoint is only used if the changes are contained to these three fields.

Copy link
Collaborator

@Integralist Integralist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bengesoff LGTM. Just a couple of minor comments.

@bengesoff
Copy link
Contributor Author

@Integralist fixed based on your feedback, and confirmed the test still passes 🙂

Unable to test as it requires a subscription to be in the "issued" state
which would depend on another provider to handle DNS.

Takes advantage of Terraform's CustomizeDiff to decide whether to update
the resource in place or recreate it.
Unfortunately can't test the PATCH endpoint as it requires the subscription being in "issued" state. However, we can at least test that the resource correctly decides not to use the PATCH endpoint as a result and instead recreates the resource.
@bengesoff bengesoff requested a review from Integralist April 6, 2021 09:53
@Integralist Integralist merged commit edde46c into fastly:master Apr 6, 2021
@Integralist Integralist added the enhancement New feature or request label Apr 6, 2021
@bengesoff bengesoff deleted the tls-subs-patch branch April 16, 2021 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants