-
Notifications
You must be signed in to change notification settings - Fork 142
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
use d.SetNewComputed for TypeSet computed attributes #453
use d.SetNewComputed for TypeSet computed attributes #453
Conversation
@@ -25,6 +25,7 @@ func resourceFastlyTLSSubscription() *schema.Resource { | |||
customdiff.ForceNewIf("configuration_id", resourceFastlyTLSSubscriptionStateNotIssued), | |||
customdiff.ForceNewIf("domains", resourceFastlyTLSSubscriptionStateNotIssued), | |||
customdiff.ForceNewIf("common_name", resourceFastlyTLSSubscriptionStateNotIssued), | |||
resourceFastlyTLSSubscriptionSetNewComputed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be marginally more readable to use the customdiff.ComputedIf()
helper method instead of calling d.SetNewComputed()
directly? I did a similar thing in #388 but up to you
Co-authored-by: Mark McDonnell <Integralist@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Any chance we can get this merged and a new point release created? Would love to test this in our environment :) |
Hi @virgofx I'll be cutting a new release on Monday morning. Thanks! |
This attempts to fix: #451
TODO:
Note:
I'm not adding acceptance tests for this change because the update action only runs for "issued" state:
https://github.com/fastly/terraform-provider-fastly/blob/v0.33.0/fastly/resource_fastly_tls_subscription.go#L23
If we're about to add tests, that require tests to interact with DNS records as well as waiting for the subscription to be issued, which isn't ideal in my view.
Reference:
hashicorp/terraform-plugin-sdk#195