fix(ioa_rule_group): accept windows ruletype_id 5 on read#401
Draft
yoclaire wants to merge 1 commit into
Draft
Conversation
Some Falcon-side Windows Process Creation rules carry ruletype_id 5 (vs the canonical 1 the provider writes). The flat name->ID map shape in ruleTypeIDMap cannot express the alias, so the inverted read map misses on these rules and the resource errors with "Unknown rule type ID". Adds a separate read-side alias map so multiple API IDs can collapse to one Terraform schema enum on read; writes are unaffected. Closes CrowdStrike#400
997c288 to
3f9bdbf
Compare
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.
Closes #400.
Adds a read-side alias map (
ruleTypeReadAliasMap) so multiple Falcon API rule-type IDs can collapse to one Terraformtypeenum value on read. Concrete case: Windows Process Creation rules created outside the provider can carryruletype_id = "5"(the provider writes"1"); the read path previously errored with "Unknown rule type ID" onterraform plan/import.Write path is unchanged —
ruleTypeIDMapstill owns one canonical API ID per Terraformtype, and the schemaOneOfvalidator atioa_rule_group_resource.go:502still pins users to the four canonical type names. The alias map only affects round-trip on read/import/refresh.Tested with
go test ./...(all packages pass). Did not runmake acctest— requiresFALCON_CLIENT_ID/FALCON_CLIENT_SECRET.See #400 for the original error text, repro, and a more general "type → list of API ids" shape that could replace this if more aliases turn up across platforms. This PR keeps the change minimal and scoped to the observed Windows/5 case.