fix: populate ID field in ovh_cloud_project_storage resource #1178
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.
Description
Fixes the
ovh_cloud_project_storageresource to properly populate theidfield in Terraform state.Problem
The
ovh_cloud_project_storageresource declares anidattribute in its schema but never populates it, leaving it asnullin the Terraform state. According to Terraform Plugin Frameworkbest practices, if an
idattribute is declared in the schema, it should be populated.This causes issues with:
ovh_cloud_project_databaseproperly populates its ID)Changes
ovhtypesimport for TfString type creationCreate()function after resource creationRead()function after fetching resource detailsUpdate()function after updating resourceservice_name/region_name/name(matches the import format defined inImportState())Benefits
Testing
Tested with:
The existing acceptance tests continue to pass as they already use the correct import ID format (
service_name/region_name/name).Backward Compatibility
This change is backward compatible since the ID field was previously
null. Adding a value doesn't break existing workflows.