Repository navigation
Import validation helper function - #1370
Open
chrismarget-j wants to merge 2 commits into
Open
chrismarget-j wants to merge 2 commits into
chrismarget-j wants to merge 2 commits into
Conversation
chrismarget-j
force-pushed
the
import-validation
branch
4 times, most recently
from
November 16, 2026 19:08
ebaad7d to
0a162ff
Compare
chrismarget-j
force-pushed
the
import-validation
branch
from
November 16, 2026 19:09
0a162ff to
a2b2585
Compare
rajagopalans
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
Identitystructs used to import Terraform resources which can't be described with a simple string (many of ours require at least anidand ablueprint_id, for example) can be marked withRequiredForImportorOptionalForImport.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