netlify_site_domain_settings_changes fix update in place without changes #121
+57
−3
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.
This error fixes state when I specify
netlify_site_domain_settings_changes
resource like this:This cause changes on each plan/apply:
This changes fixes the issue.
This pull request improves the handling of optional fields in the
site_domain_settings
resource by ensuring null values are explicitly managed and adds a new test case to prevent configuration drift. The changes enhance both the functionality and reliability of the resource.Enhancements to
site_domain_settings
resource:Read
method ininternal/provider/site_domain_settings_resource.go
to explicitly set optional fields (CustomDomain
,BranchDeployCustomDomain
, andDeployPreviewCustomDomain
) toStringNull
when they are not provided by the API. This ensures consistent state representation for optional fields.New test case for preventing configuration drift:
TestAccSiteDomainSettingsNullFields
ininternal/provider/site_domain_settings_resource_test.go
. This test verifies that optional fields remain null when not set and ensures no drift occurs when reapplying the same configuration. It also includes an import verification step.