Skip to content

Commit

Permalink
SUMO-248048: updated the documentations for scheduled_views, data_for…
Browse files Browse the repository at this point in the history
…warding_rule and data_forwarding_destination and added example to correctly configure the data forwarding rule for a scheduled view
  • Loading branch information
namangoya committed Sep 21, 2024
1 parent 5dab9b8 commit fdf9bc4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
4 changes: 2 additions & 2 deletions website/docs/r/data_forwarding_destination.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ resource "sumologic_data_forwarding_destination" "example_data_forwarding_destin
access_key_id = "accessKeyId"
secret_access_key = "secretAccessKey"
role_arn = "arn:aws:iam::some-valid-arn"
encrypted = "false"
enabled = "true"
encrypted = false
enabled = true
}
```
## Argument reference
Expand Down
40 changes: 34 additions & 6 deletions website/docs/r/data_forwarding_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,38 @@ 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_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]
}
}
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
enabled = false
file_format = "test/{index}"
payload_schema = "raw"
format = "text"
}
```
## Argument reference
Expand All @@ -31,3 +55,7 @@ The following arguments are supported:
_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
3 changes: 2 additions & 1 deletion website/docs/r/scheduled_view.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ QUERY
retention_period = 365
lifecycle {
prevent_destroy = true
ignore_changes = [index_id]
}
}
```
Expand All @@ -44,7 +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.
- `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]`.

## 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].
Expand Down

0 comments on commit fdf9bc4

Please sign in to comment.