SUMO-275219: Terraform support for event extraction#840
SUMO-275219: Terraform support for event extraction#840achugh-sumo wants to merge 5 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements Terraform support for Event Extraction Rules CRUD operations, enabling users to create, read, update, and delete event extraction rules that extract structured events from log data in Sumo Logic.
Changes:
- Added new
sumologic_event_extraction_ruleTerraform resource with full CRUD operations - Created comprehensive documentation with examples for basic usage and correlation expressions
- Implemented client API methods for interacting with the Event Extraction Rules API endpoint
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/r/event_extraction_rule.html.markdown | Documentation for the new event extraction rule resource including usage examples and schema definitions |
| sumologic/sumologic_event_extraction_rule.go | API client implementation with methods for CRUD operations on event extraction rules |
| sumologic/resource_sumologic_event_extraction_rule.go_test | Acceptance tests covering create, update, and destroy operations |
| sumologic/resource_sumologic_event_extraction_rule.go | Terraform resource implementation with schema definition and CRUD handlers |
| sumologic/provider.go | Registration of the new event extraction rule resource in the provider |
| CHANGELOG.md | Entry documenting the new event extraction rule support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0434d45 to
a19a9a2
Compare
f09a951 to
60be234
Compare
60be234 to
416f726
Compare
416f726 to
0dd46ff
Compare
|
LGTM |
ssharma-sumologic
left a comment
There was a problem hiding this comment.
Please mention the details of testing performed in the description
| Type: schema.TypeString, | ||
| Required: true, | ||
| ValidateFunc: validation.StringInSlice( | ||
| []string{"ExactMatch"}, |
There was a problem hiding this comment.
setting this would require you to keep making changes here and api side whenever we add more choices, I would recommend to remove this validation and let it fail on server side, general validations which ensure bad input isn't sent are good to do here, however specific validation which would force to have sync between terraform code and api code would add to maintainability
There was a problem hiding this comment.
If we actually see MaxItems we allow in list also as 1. also string_match_algorithm that we want to allow is also 1. So if we make changes to API to allow other type of correlation like AND or OR, then we need to update TF anyhow. So not really inclined towards making this change
Similarly for mapping_type, we only allow HARD_CODED
| }, | ||
| }, | ||
|
|
||
| "configuration": { |
There was a problem hiding this comment.
This approach doesn't force us to mention configuration details for all 4-5 fields which are mandatory, we should add those names in description so that it's available as hint, also should we not have some validation logic to verify we have those fields before calling api. I mean shuold we not force user to mention mandatory fields ?
There was a problem hiding this comment.
all validations part of API should be fine
| name = "deployment-event" | ||
| query = "_sourceCategory=deployments" | ||
|
|
||
| configuration { |
There was a problem hiding this comment.
Is this still inline with the typeset change ( Just requesting to confirm )
|
|
||
| BUG FIXES: | ||
| * Fix for failing content test case for scheduled searches | ||
| * Support for Event extraction rules. |
There was a problem hiding this comment.
This will come under FEATURES: section .
Description
Terraform support for event extraction CRUD
API doc: https://stag-api.sumologic.net/docs/internal/index.html#tag/eventAnalytics
Check list
CHANGELOG.mdCONTRIBUTING.mdfor anything forgotten