Skip to content

Import validation helper function - #1370

Open
chrismarget-j wants to merge 2 commits into
1368-move-apstraprivate-to-internalprivatefrom
import-validation
Open

chrismarget-j wants to merge 2 commits into
1368-move-apstraprivate-to-internalprivatefrom
import-validation

Conversation

@chrismarget-j

@chrismarget-j chrismarget-j commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

The Identity structs used to import Terraform resources which can't be described with a simple string (many of ours require at least an id and a blueprint_id, for example) can be marked with RequiredForImport or OptionalForImport.

This PR introduces a helper function which compares the identity struct to ensure that it includes all of the fields marked RequiredForImport.

Ordinarily that wouldn't be required: The framework already checks that the identity is properly filled in before handing it off. But there's a second code path which isn't subjected to the framework's checks: The id-string-based import approach where the user gives us a JSON string describing the identity. This is the legacy import style which isn't very well suited to composite identities. We unmarshal those strings onto an identity and then will use this helper function to validate it.

This code is used by VirtualNetworkAssignmentIdentity.ParseLegacyID() in #1373

@chrismarget-j
chrismarget-j added this pull request to stack #1364 November 7, 2026 03:08
@chrismarget-j
chrismarget-j force-pushed the import-validation branch 4 times, most recently from ebaad7d to 0a162ff Compare November 16, 2026 19:08
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.

2 participants