New Resource: azurerm_storage_mover_smb_mount_endpoint#31589
New Resource: azurerm_storage_mover_smb_mount_endpoint#31589hqhqhqhqhqhqhqhqhqhqhq wants to merge 9 commits intohashicorp:mainfrom
azurerm_storage_mover_smb_mount_endpoint#31589Conversation
azurerm_storage_mover_smb_mount_endpoint
b98ee4e to
2475163
Compare
7504963 to
b117070
Compare
b117070 to
b9219a7
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for managing Azure Storage Mover SMB Mount Endpoints in the provider, including documentation and acceptance coverage.
Changes:
- Introduces the
azurerm_storage_mover_smb_mount_endpointresource implementation (CRUD) wired toMicrosoft.StorageMover/endpoints. - Adds acceptance tests for basic, complete (with Key Vault credentials), update, and import flows.
- Publishes new resource documentation and registers the resource in the Storage Mover service.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
website/docs/r/storage_mover_smb_mount_endpoint.html.markdown |
New docs page for the SMB mount endpoint resource, including examples and argument/timeout/import sections. |
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource.go |
New resource implementation for SMB mount endpoints (create/read/update/delete) using the Storage Mover endpoints client. |
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource_test.go |
New acceptance tests covering create/import/update flows, including Key Vault-backed credentials. |
internal/services/storagemover/registration.go |
Registers the new SMB mount endpoint resource with the Storage Mover service. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource.go
Outdated
Show resolved
Hide resolved
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource.go
Outdated
Show resolved
Hide resolved
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource.go
Outdated
Show resolved
Hide resolved
internal/services/storagemover/storage_mover_smb_mount_endpoint_resource.go
Outdated
Show resolved
Hide resolved
gerrytan
left a comment
There was a problem hiding this comment.
Thx @hqhqhqhqhqhqhqhqhqhqhq , I left some comments regarding the schema design and validation.
Also can you please address the Copilot generated review comments.
|
|
||
| type StorageMoverSmbMountEndpointResource struct{} | ||
|
|
||
| var _ sdk.ResourceWithUpdate = StorageMoverSmbMountEndpointResource{} |
There was a problem hiding this comment.
Need to also implement sdk.ResourceWithIdentity, please check guide-new-resource.md
There was a problem hiding this comment.
Added 👍
| Type: pluginsdk.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validation.StringIsNotEmpty, |
There was a problem hiding this comment.
Can you please check if stronger validation than StringIsNotEmpty be used? Please check what kind of validation used in portal.
Same concern with other fields with "StringIsNotEmpty" validation.
There was a problem hiding this comment.
host: Must be (1) IPv4 address or (2) hostname/FQDN → added validation for this
share_name: Portal: “Must be 1-80 characters and cannot contain: /[]:<> + = ;, *? or control characters” → Updated
description: Portal: “1024 characters max” → added validation for this
| ValidateFunc: validation.StringIsNotEmpty, | ||
| }, | ||
|
|
||
| "username_uri": { |
There was a problem hiding this comment.
This should be called username_key_vault_secret_id assuming it works if I supply a azurerm_key_vault_secret.mysecret.id here. Same apply to password_uri.
There was a problem hiding this comment.
Both attributes are renamed to username_key_vault_secret_id and password_key_vault_secret_id
- examples/storage-mover: full example with SMB mount endpoint, validation-test-invalid.tf.example, README Made-with: Cursor
…oint)" This reverts commit 7a0f24b.
…d, rename credentials to key vault secret IDs - Implement ResourceWithIdentity: call SetResourceIdentityData after SetID in Create and in Read to fix 'Missing Resource Identity After Create' - Align Create with guide: return metadata.Encode after SetResourceIdentityData - Rename username_uri/password_uri to username_key_vault_secret_id/password_key_vault_secret_id in schema, docs and tests (PR feedback) Made-with: Cursor
Add stricter validation and credential handling for StorageMover SMB mount endpoints. Host now must be a valid IPv4 address or hostname/FQDN; share_name is limited to 1-80 characters and forbids control characters and a set of punctuation; description is limited to 1024 characters. Update Update() logic to require both username_key_vault_secret_id and password_key_vault_secret_id to be set together (or both empty) and to set/clear credentials accordingly. Adjust tests formatting and update R docs to describe the new validation rules.
… Read for description and credentials Made-with: Cursor
…fy target_endpoint docs Made-with: Cursor
Made-with: Cursor
This PR adds a new resource
azurerm_storage_mover_smb_mount_endpointfor managing Storage Mover SMB Mount Endpoints, enabling data migration from on-premises SMB file shares to Azure.Community Note
Description
This PR introduces the
azurerm_storage_mover_smb_mount_endpointresource, which allows users to create SMB Mount endpoints for migrating data from on-premises SMB file shares to Azure using Azure Storage Mover.Properties:
name- (Required) The name of the endpointstorage_mover_id- (Required) The ID of the Storage Moverhost- (Required) The hostname or IP address of the SMB servershare_name- (Required) The name of the SMB shareusername_uri- (Optional) The Azure Key Vault secret URI for the usernamepassword_uri- (Optional, Sensitive) The Azure Key Vault secret URI for the passworddescription- (Optional) A description for the endpointThis resource uses API version
2025-07-01.PR Checklist
New Resource
Testing
Acceptance tests pass for the new resource.
Change Log
azurerm_storage_mover_smb_mount_endpoint[New Resource:azurerm_storage_mover_smb_mount_endpoint#31589]This is a (please select all that apply):
Related Issue(s)
N/A
AI Assistance Disclosure
AI was used to assist with code generation, documentation, and test implementation.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
No changes to security controls in this pull request.