fix: add custom external name configuration for cloud_project_storage #38
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
Adds custom external name configuration for the
ovh_cloud_project_storageresource to support the patched OVH Terraform provider that properly populates the ID field.Problem
The
ovh_cloud_project_storageresource requires custom external name configuration because:service_name/region_name/nameWithout this configuration, the resource cannot:
Changes
config/external_name.gostorageIdentifierFromProviderconfiguration with:GetExternalNameFn: Parses composite ID and extracts bucket name (last component)GetIDFn: Constructs composite import ID from parameters (service_name/region_name/name)ovh_cloud_project_storageto ExternalNameConfigs mapconfig/cloud/config.goShortGroup = "cloud"for storage resourceHow It Works
During resource creation:
ProjectRegionStoragewithmetadata.name: my-bucketservice123/GRA/my-bucketGetExternalNameFnextractsmy-bucketas external nameDuring import:
my-bucketwith parametersGetIDFnconstructs import ID:service123/GRA/my-bucketGetExternalNameFnextracts bucket name for CrossplaneDepends On
This configuration works with the patched OVH Terraform provider pending PRs at https://github.com/ovh/terraform-provider-ovh:
Until those PRs are merged, users can use a locally patched provider via filesystem mirror.
Testing
Tested with patched provider (v2.9.0):
Example Usage