tools/importer-rest-api-specs
: flagging fields that are expected to be Computed in the Terraform Schema to be ReadOnly for now
#3899
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 PR works around an issue described in #3895 where due to an issue when parsing the Swaggers the
ReadOnly
information is inconsistent - meaning that currently when generating Terraform Resources, an issue exists where fields that should be marked as Computed aren't being picked up as such - the results can be seen in hashicorp/terraform-provider-azurerm#25052.This issue stems from the fact that we now explicitly differentiate values which are
ReadOnly
from those which aren't, since we're now canonically using theSDKModel
type throughout - meaning that when generating the Terraform Schema for the specified resource we're using the SDKField'sReadOnly
property to indicate that the associated Terraform Schema Field should be marked asComputed
.Since the root cause of this issue is an issue when parsing the Swagger definitions - this PR intentionally applies a Data Workaround rather than attempting to patch this within the Terraform side of things - which isn't ideal, but feels like the right place to apply this since we'll need to look into #3895 once the refactoring is completed.
Ultimately this PR means that the changes from hashicorp/terraform-provider-azurerm#25052 become a noop - which'll fix the Terraform Generator.
Changes as a result of this diff: