Skip to content

TFECO-9155: Support importing by resource identity for sdkv2 resource#333

Merged
ansgarm merged 9 commits intomainfrom
sdk-identity-import
May 8, 2025
Merged

TFECO-9155: Support importing by resource identity for sdkv2 resource#333
ansgarm merged 9 commits intomainfrom
sdk-identity-import

Conversation

@ansgarm
Copy link
Member

@ansgarm ansgarm commented Apr 15, 2025

depends on hashicorp/terraform-plugin-sdk#1463

  • add tests using new plugin-testing functionality

@austinvalle austinvalle force-pushed the sdk-identity-import branch from 1bcce18 to af1f0af Compare April 18, 2025 19:10
@ansgarm ansgarm force-pushed the sdk-identity-import branch from 72181c9 to 1cf238e Compare April 22, 2025 12:39
@ansgarm ansgarm marked this pull request as ready for review April 22, 2025 14:54
@ansgarm ansgarm requested a review from a team as a code owner April 22, 2025 14:54
@ansgarm ansgarm changed the title support importing by resource identity for sdkv2 resource TFECO-9155: Support importing by resource identity for sdkv2 resource Apr 22, 2025
@ansgarm ansgarm requested review from austinvalle and Copilot May 2, 2025 08:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for importing resources by resource identity for the sdkv2 provider while transitioning from the legacy email field to separate local_part and domain fields.

  • Updated the resource identity schema and identity upgrader to split the email field.
  • Enhanced the importer to reconstruct the email from the new identity fields.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/sdkv2provider/resource_user_identity_test.go Test updates to verify identity splitting and importer behavior.
internal/sdkv2provider/resource_user_identity.go Changes to support resource identity import with versioned schema.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ansgarm ansgarm force-pushed the sdk-identity-import branch 2 times, most recently from 96ac190 to 840533f Compare May 7, 2025 09:05
@ansgarm ansgarm force-pushed the sdk-identity-import branch from 840533f to 22cec49 Compare May 7, 2025 09:06
@ansgarm ansgarm requested a review from austinvalle May 7, 2025 14:10
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good! One nit and looks like the go.mod needs to be updated for that new identity pass through 👍🏻

@ansgarm ansgarm requested a review from austinvalle May 8, 2025 07:00
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@ansgarm ansgarm merged commit 8017d93 into main May 8, 2025
99 checks passed
@ansgarm ansgarm deleted the sdk-identity-import branch May 8, 2025 12:52
brandonc pushed a commit to brandonc/terraform-provider-corner that referenced this pull request May 28, 2025
…hashicorp#333)

* support importing by resource identity for sdkv2 resource

* add steps to test import from identity

* updated the version

* tested resource identity upgrade by manually changing identity version

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* split identity schema upgrade test into it's own resource and test case

* fix identity upgrader version

* update to latest main of plugin-sdk, drop unused upgrade function, tidy go mod

* use tagged switch to please linter

---------

Co-authored-by: Austin Valle <austinvalle@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants