Skip to content

Support import for msgraph_resource_collection#97

Merged
ms-henglu merged 2 commits intomainfrom
support-import-resource-collection
Mar 3, 2026
Merged

Support import for msgraph_resource_collection#97
ms-henglu merged 2 commits intomainfrom
support-import-resource-collection

Conversation

@ms-henglu
Copy link
Collaborator

Summary

Implement ImportState for msgraph_resource_collection resource, allowing users to import existing $ref collections into Terraform state.

Import ID Format

The import ID is the collection URL ending with /$ref:

terraform import msgraph_resource_collection.group_members groups/{group-id}/members/$ref

An optional ?api-version=beta query parameter can specify the API version (defaults to v1.0):

terraform import msgraph_resource_collection.group_members 'groups/{group-id}/members/$ref?api-version=beta'

Changes

  • Added ImportState method to MSGraphResourceCollection
  • Added import example for documentation (examples/resources/msgraph_resource_collection/import.sh)
  • Regenerated docs to include the Import section
  • Added import tests (TestAcc_ResourceCollectionImport, TestAcc_ResourceCollectionImportWithApiVersion)
  • Added import steps to existing tests (TestAcc_ResourceCollectionBasic, TestAcc_ResourceCollectionUpdate)
  • Updated CHANGELOG.md with v0.4.0 entry

Fixes #88

@ms-henglu ms-henglu requested a review from magodo March 3, 2026 03:11
@ms-henglu ms-henglu merged commit 97383ff into main Mar 3, 2026
10 checks passed
@ms-henglu ms-henglu deleted the support-import-resource-collection branch March 3, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support import for msgraph_resource_collection

2 participants