-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SUMO-248024: #691
SUMO-248024: #691
Changes from 5 commits
bbd6b34
5dab9b8
78a8578
723064f
138fe92
0789980
d33dd93
651ae55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ | |
DEPRECATIONS: | ||
* resource_sumologic_ingest_budget : Deprecated in favour of `resource_sumologic_ingest_budget_v2`. | ||
|
||
## 2.31.5 (September 23, 2024) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove date. Date shall be added on the day of release There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, done |
||
ENHANCEMENTS: | ||
* Added *index_id* attribute to sumologic_scheduled_view. (GH-691) | ||
* Added support for configuring sumologic_data_forwarding_rule for sumologic_scheduled_view. (GH-691) | ||
|
||
## 2.31.4 (September 19, 2024) | ||
* **New Resource:** sumologic_data_forwarding_destination (GH-678) | ||
* **New Resource:** sumologic_data_forwarding_rule (GH-688) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,12 +33,10 @@ func resourceSumologicDataForwardingRule() *schema.Resource { | |
"enabled": { | ||
Type: schema.TypeBool, | ||
Optional: true, | ||
Default: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a change in behavior. A rule will be disabled by default now? This might be a breaking change. The good part is we are scheduled for a major release if this is a breaking change it should be fine. We should document the new behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
"file_format": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "{index}_{day}_{hour}_{minute}_{second}", | ||
}, | ||
"payload_schema": { | ||
Type: schema.TypeString, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ func (s *Client) DeleteDataForwardingRule(indexId string) error { | |
type DataForwardingRule struct { | ||
IndexId string `json:"indexId"` | ||
DestinationId string `json:"destinationId"` | ||
Enabled bool `json:"enabled,omitempty"` | ||
Enabled bool `json:"enabled"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we making this change? This will send value as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bad part is that We are not setting any default for I've tested this scenario.. |
||
FileFormat string `json:"fileFormat,omitempty"` | ||
PayloadSchema string `json:"payloadSchema,omitempty"` | ||
Format string `json:"format,omitempty"` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,25 +9,61 @@ description: |- | |
Provider to manage [Sumologic Data Forwarding Rule](https://help.sumologic.com/docs/manage/data-forwarding/amazon-s3-bucket/#forward-datato-s3) | ||
|
||
## Example Usage | ||
|
||
For Partitions | ||
```hcl | ||
resource "sumologic_partition" "test_partition" { | ||
name = "testing_rule_partitions" | ||
routing_expression = "_sourcecategory=abc/Terraform" | ||
is_compliant = false | ||
retention_period = 30 | ||
analytics_tier = "flex" | ||
} | ||
|
||
resource "sumologic_data_forwarding_rule" "example_data_forwarding_rule" { | ||
index_id = "00000000024C6155" | ||
destination_id = "00000000000732AA" | ||
enabled = "true" | ||
file_format = "test/{index}/{day}/{hour}/{minute}" | ||
payload_schema = "builtInFields" | ||
format = "json" | ||
index_id = sumologic_partition.test_partition.id | ||
destination_id = "00000000000732AA" | ||
enabled = true | ||
file_format = "test/{index}/{day}/{hour}/{minute}" | ||
payload_schema = "builtInFields" | ||
format = "json" | ||
} | ||
``` | ||
For Scheduled Views | ||
```hcl | ||
resource "sumologic_scheduled_view" "failed_connections" { | ||
index_name = "failed_connections" | ||
query = "_sourceCategory=fire | count" | ||
start_time = "2024-09-01T00:00:00Z" | ||
retention_period = 1 | ||
lifecycle { | ||
prevent_destroy = true | ||
ignore_changes = [index_id] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not needed now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I have just kept if for the fact that if someone explicitly tries to set |
||
} | ||
} | ||
|
||
resource "sumologic_data_forwarding_rule" "test_rule_sv" { | ||
index_id = sumologic_scheduled_view.failed_connections.index_id | ||
destination_id = sumologic_data_forwarding_destination.test_destination.id | ||
Comment on lines
+45
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens when user supplies both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are just using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This behavior should be documented in the terraform docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we are documenting it in the SV page itself as it belongs to SV. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the docs in the latest commit. |
||
enabled = false | ||
file_format = "test/{index}" | ||
payload_schema = "raw" | ||
format = "text" | ||
} | ||
``` | ||
## Argument reference | ||
|
||
The following arguments are supported: | ||
|
||
- `index_id` - (Required) The _id_ of the Partition or Scheduled View the rule applies to. | ||
- `index_id` - (Required) The *id* of the Partition or *index_id* of the Scheduled View the rule applies to. | ||
- `destination_id` - (Required) The data forwarding destination id. | ||
- `enabled` - (Required) True when the data forwarding rule is enabled. | ||
- `enabled` - (Optional) True when the data forwarding rule is enabled. Will be treated as _false_ if left blank. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add possible values for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed, we already have a descriptive documentation ... and that is added on top of this page - see here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I disagree, we should cover the possible values here. Can't rely on an example to do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall I update this Rule's TF documentation and add a pointer to the original documentation here (point 6) in that case? Possible values for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the docs in the latest commit. |
||
- `file_format` - (Optional) Specify the path prefix to a directory in the S3 bucket and how to format the file name. | ||
- `payload_schema` - (Optional) Schema for the payload. Default value of the payload schema is _allFields_ for scheduled view, and _builtInFields_ for partition. | ||
_raw_ payloadSchema should be used in conjunction with _text_ format and vice versa. | ||
- `format` - (Optional) Format of the payload. Default format will be _csv_. | ||
_text_ format should be used in conjunction with _raw_ payloadSchema and vice versa. | ||
|
||
The following attributes are exported: | ||
|
||
- `id` - The Index ID of the data_forwarding_rule |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ QUERY | |
retention_period = 365 | ||
lifecycle { | ||
prevent_destroy = true | ||
ignore_changes = [index_id] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a comment here explaining why we need to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added in this same doc a little below at line 48. |
||
} | ||
} | ||
``` | ||
|
@@ -44,6 +45,7 @@ The following arguments are supported: | |
The following attributes are exported: | ||
|
||
- `id` - The internal ID of the scheduled view. | ||
- `index_id` - The Index ID of the scheduled view. It never updates at any point of time during resource updates, therefore make sure to ignore this via `ignore_changes = [index_id]`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a gap in the API. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if the user passes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think this is right behavior. We are silently dropping a field provided by the client. Instead we should return error b/c request is invalid as you are not allowed to change the index id. This is the real issue here. It should be noted that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, not a strict requirement to add
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We can follow-up internally on this one. I don't see a reason why OpenAPI would silently drop a field.
The language should be updated to reflect that. Currently, it seems we are asking to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sure, can I know the set of people who can help me here? Also, is it a blocker for this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Issue is resolved with the introduction of computed prop for I'm updating the documentation that |
||
|
||
## Import | ||
Scheduled Views can can be imported using the id. The list of scheduled views and their ids can be obtained using the Sumologic [scheduled views api][2]. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a little strange to be doing a 2.x release while having the
3.0.0
section in the CHANGELOG, with content in it already. But I think it's ok.(Also, an
(Unreleased)
on the2.31.5
line would be appropriate, but there's no need to change it; one of us will be editing that line with the correct date anyway.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh, I thought that 3.0.0 is written for some other purpose.. and didn't thought of using that, just continued after 2.31.3 ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dagould are you planning to maintain two versions of the provider? I would be in favor of just continuing
3.x.x
version.