feat: Add Terraform support for Chronicle Parser and ParserExtension#17732
feat: Add Terraform support for Chronicle Parser and ParserExtension#17732govisingh-dotcom wants to merge 2 commits into
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
| # limitations under the License. | ||
|
|
||
| --- | ||
| name: Parser |
There was a problem hiding this comment.
Can you break this into two PRs, one per resource type? Review quality drops tremendously when covering two separate resources in one review.
There was a problem hiding this comment.
raised a new PR - #17774
pls checkout @rileykarson @ankitgoyal0301
|
|
||
| --- | ||
| name: Parser | ||
| description: Description |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 81e8cb1: Diff reportYour PR generated the following diffs in downstream repositories:
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_chronicle_parser" "primary" {
changelogs {
entries {
change_message = # value needed
create_time = # value needed
deleted = # value needed
parser_version = # value needed
}
}
low_code {
field_extractors {
append_repeated_fields = # value needed
extractors {
value = # value needed
}
preprocess_config {
grok_regex = # value needed
target = # value needed
}
}
}
version_info {
auto_upgrade_disabled = # value needed
}
}
Resource: resource "google_chronicle_parser_extension" "primary" {
dynamic_parsing {
opted_fields {
path = # value needed
sample_value = # value needed
}
}
field_extractors {
append_repeated_fields = # value needed
extractors {
precondition_op = # value needed
precondition_path = # value needed
precondition_value = # value needed
}
preprocess_config {
grok_regex = # value needed
target = # value needed
}
}
}
Multiple resources addedThis PR adds multiple new resources: Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the replaying VCR build log Step 2: Recording Mode
🟢 All tests passed! View the recording VCR build log or the debug logs folder for detailed results. @govisingh-dotcom, @ankitgoyal0301 VCR tests complete for 81e8cb1! |
| references: | ||
| guides: | ||
| 'Custom parsers overview': 'https://cloud.google.com/chronicle/docs/detection/custom-parsers-overview' | ||
| api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances.logTypes.parsers' |
There was a problem hiding this comment.
I believe we are directly adding support to GA provider. Please point this to v1 documentation.
| - projects/{{project}}/locations/{{location}}/instances/{{instance}}/logTypes/{{logtype}}/parsers/{{parser}} | ||
| autogen_status: UGFyc2Vy | ||
| autogen_async: false | ||
| examples: |
There was a problem hiding this comment.
Can you please add update acceptance tests also?
Description
This pull request introduces Terraform support for two new resources under the Chronicle
ParserServiceAPI surface:google_chronicle_parser: Manages Chronicle custom parsers (updatable, server-assigned IDs).google_chronicle_parser_extension: Manages Chronicle parser extensions (immutable, server-assigned IDs).These resources utilize the standard regionalized control plane endpoint
https://{{location}}-chronicle.googleapis.com/v1beta/to ensure correct GFE routing, and implement short-ID mapping using theid_from_name.tmplcustom flattener for their server-assigned UUID identifiers.Key changes include:
mmv1/products/chronicle/Parser.yaml.mmv1/products/chronicle/ParserExtension.yaml.mmv1/templates/terraform/examples/chronicle_parser_basic.tf.tmplandchronicle_parser_full.tf.tmpl.mmv1/templates/terraform/examples/chronicle_parserextension_basic.tf.tmplandchronicle_parserextension_full.tf.tmpl.referencesmetadata section for both resources.ignore_read_extrafor asynchronous validation properties (state,validation_report,validation_stage,state_last_changed_time,extension_validation_report) to prevent eventual-consistency timing flakiness duringImportStateVerify.Tested
To address reviewer feedback and ensure robust validation of all optional, nested, and complex UDM blocks, we added four automated acceptance tests (two per resource).
Furthermore, to guarantee safe parallel execution in the GitHub CI presubmits and prevent Spanner locking collisions, each test has been mapped to a completely unique prebuilt log type:
TestAccChronicleParser_chronicleParserBasicExample(WINDOWS_DHCP)TestAccChronicleParser_chronicleParserFullExample(LINUX_DHCP)TestAccChronicleParserExtension_chronicleParserextensionBasicExample(CISCO_DHCP)TestAccChronicleParserExtension_chronicleParserextensionFullExample(AKAMAI_DHCP)All 4 tests successfully compiled and PASSED concurrently in parallel in the developer workstation sandbox: