fix(windows_update_ring): make deadline_settings attributes optional and computed for import support #869
+91
−63
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.
Summary
Fixes import validation errors for
microsoft365_graph_beta_device_management_windows_update_ringresource by makingdeadline_settingsattributes optional and computed instead of required.Issue Reference
Fixes validation errors during import where required attributes in
deadline_settingsblock fail validation because they don't exist in the configuration during import operations.Motivation and Context
deadline_settingsblock had four attributes marked asRequired: true, causing import operations to fail with validation errors since these values don't exist in the Terraform configuration during import - they must be fetched from the API.Requiredwill fail validation during this process because Terraform expects them in the configuration, but import workflows don't have configuration yet.windowsUpdateForBusinessConfigurationresource defines these attributes as optional Int32 and Boolean types with no required constraints.Dependencies
Changes Made
File:
internal/services/resources/device_management/graph_beta/windows_update_ring/resource.goAdded
Computed: truetodeadline_settingsblock:Changed
deadline_for_feature_updates_in_daysfromRequiredtoOptional + Computed:Required: true(user must provide in configuration)Optional: true, Computed: true(user can provide OR provider fetches from API)Changed
deadline_for_quality_updates_in_daysfromRequiredtoOptional + Computed:Changed
deadline_grace_period_in_daysfromRequiredtoOptional + Computed:Changed
postpone_reboot_until_after_deadlinefromRequiredtoOptional + Computed:All four attributes retain their existing validators (e.g.,
Between(0, 30)for deadlines) to ensure valid values whether user-provided or API-fetched.Type of Change
Please mark the relevant option with an
x:Testing
terraform validateusing local dev overrideQuality Checklist
Screenshots/Recordings (if appropriate)
[Add screenshots or recordings that demonstrate the changes]
Additional Notes
[Add any additional information that might be helpful for reviewers]