Skip to content

Commit 80135ce

Browse files
merge master
2 parents 1164d3c + 842ed32 commit 80135ce

12 files changed

+89
-29
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
DEPRECATIONS:
33
* resource_sumologic_ingest_budget : Deprecated in favour of `resource_sumologic_ingest_budget_v2`.
44

5-
## 2.31.5 (Unreleased)
5+
## 2.31.5
6+
ENHANCEMENTS:
7+
* Added *index_id* attribute to sumologic_scheduled_view. (GH-691)
8+
* Added support for configuring sumologic_data_forwarding_rule for sumologic_scheduled_view. (GH-691)
69
BUG FIXES:
710
* fix analytics_tier case sensitivity in resource_sumologic_partition (GH-692)
811

sumologic/resource_sumologic_data_forwarding_destination.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func resourceSumologicDataForwardingDestination() *schema.Resource {
6161
"enabled": {
6262
Type: schema.TypeBool,
6363
Optional: true,
64-
Default: false,
6564
},
6665
"s3_region": {
6766
Type: schema.TypeString,

sumologic/resource_sumologic_data_forwarding_rule.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ func resourceSumologicDataForwardingRule() *schema.Resource {
3333
"enabled": {
3434
Type: schema.TypeBool,
3535
Optional: true,
36-
Default: true,
3736
},
3837
"file_format": {
3938
Type: schema.TypeString,
4039
Optional: true,
41-
Default: "{index}_{day}_{hour}_{minute}_{second}",
4240
},
4341
"payload_schema": {
4442
Type: schema.TypeString,

sumologic/resource_sumologic_data_forwarding_rule_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestAccSumologicDataForwardingRule_basic(t *testing.T) {
6060
testAccCheckDataForwardingRuleExists(),
6161
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "index_id", indexId),
6262
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "destination_id", destinationId),
63-
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "enabled", "true"),
63+
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "enabled", "false"),
6464
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "file_format", "test/"),
6565
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "payload_schema", "builtInFields"),
6666
resource.TestCheckResourceAttr(dataForwardingRuleResourceName, "format", "json"),
@@ -227,7 +227,7 @@ func testAccSumologicDataForwardingRuleUpdateConfig() string {
227227
resource "sumologic_data_forwarding_rule" "test" {
228228
index_id = "%s"
229229
destination_id = "%s"
230-
enabled = true
230+
enabled = false
231231
file_format = "test/"
232232
payload_schema = "builtInFields"
233233
format = "json"

sumologic/resource_sumologic_scheduled_view.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ func resourceSumologicScheduledView() *schema.Resource {
3737
ForceNew: true,
3838
ValidateFunc: validation.IsRFC3339Time,
3939
},
40+
"index_id": {
41+
Type: schema.TypeString,
42+
Optional: true,
43+
Computed: true,
44+
},
4045
"retention_period": {
4146
Type: schema.TypeInt,
4247
Optional: true,
@@ -76,6 +81,7 @@ func resourceSumologicScheduledViewCreate(d *schema.ResourceData, meta interface
7681
}
7782

7883
d.SetId(createdSview.ID)
84+
d.Set("index_id", createdSview.IndexId)
7985
d.Set("retention_period", createdSview.RetentionPeriod)
8086
}
8187

@@ -99,6 +105,7 @@ func resourceSumologicScheduledViewRead(d *schema.ResourceData, meta interface{}
99105
return nil
100106
}
101107

108+
d.Set("index_id", sview.IndexId)
102109
d.Set("query", sview.Query)
103110
d.Set("index_name", sview.IndexName)
104111
d.Set("start_time", sview.StartTime.Format(time.RFC3339))

sumologic/sumologic_data_forwarding_rule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (s *Client) DeleteDataForwardingRule(indexId string) error {
6262
type DataForwardingRule struct {
6363
IndexId string `json:"indexId"`
6464
DestinationId string `json:"destinationId"`
65-
Enabled bool `json:"enabled,omitempty"`
65+
Enabled bool `json:"enabled"`
6666
FileFormat string `json:"fileFormat,omitempty"`
6767
PayloadSchema string `json:"payloadSchema,omitempty"`
6868
Format string `json:"format,omitempty"`

sumologic/sumologic_scheduled_view.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func (s *Client) UpdateScheduledView(sview ScheduledView) error {
5858

5959
type ScheduledView struct {
6060
ID string `json:"id,omitempty"`
61+
IndexId string `json:"indexId,omitempty"`
6162
Query string `json:"query"`
6263
IndexName string `json:"indexName"`
6364
StartTime time.Time `json:"startTime"`

sumologic/sumologic_sources.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type Source struct {
2525
ForceTimeZone bool `json:"forceTimeZone"`
2626
DefaultDateFormats []DefaultDateFormat `json:"defaultDateFormats,omitempty"`
2727
Filters []Filter `json:"filters,omitempty"`
28+
HashAlgorithm string `json:"hashAlgorithm,omitempty"`
2829
CutoffTimestamp int `json:"cutoffTimestamp,omitempty"`
2930
CutoffRelativeTime string `json:"cutoffRelativeTime,omitempty"`
3031
Fields map[string]interface{} `json:"fields,omitempty"`
@@ -142,6 +143,12 @@ func resourceSumologicSource() *schema.Resource {
142143
},
143144
},
144145
},
146+
"hash_algorithm": {
147+
Type: schema.TypeString,
148+
Optional: true,
149+
Default: nil,
150+
ValidateFunc: validation.StringInSlice([]string{"MD5", "SHA-256"}, false),
151+
},
145152
"cutoff_timestamp": {
146153
Type: schema.TypeInt,
147154
Optional: true,
@@ -234,6 +241,7 @@ func resourceToSource(d *schema.ResourceData) Source {
234241
source.ForceTimeZone = d.Get("force_timezone").(bool)
235242
source.DefaultDateFormats = getDefaultDateFormats(d)
236243
source.Filters = getFilters(d)
244+
source.HashAlgorithm = d.Get("hash_algorithm").(string)
237245
source.CutoffTimestamp = d.Get("cutoff_timestamp").(int)
238246
source.CutoffRelativeTime = d.Get("cutoff_relative_time").(string)
239247
source.Fields = d.Get("fields").(map[string]interface{})
@@ -259,6 +267,7 @@ func resourceSumologicSourceRead(d *schema.ResourceData, source Source) error {
259267
if err := d.Set("filters", flattenFilters(source.Filters)); err != nil {
260268
return fmt.Errorf("error setting filters for resource %s: %s", d.Id(), err)
261269
}
270+
d.Set("hash_algorithm", source.HashAlgorithm)
262271
d.Set("cutoff_timestamp", source.CutoffTimestamp)
263272
d.Set("cutoff_relative_time", source.CutoffRelativeTime)
264273
if err := d.Set("fields", source.Fields); err != nil {

website/docs/index.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The following properties are common to ALL sources and can be used to configure
126126
- `force_timezone` - (Optional) Type true to force the source to use a specific time zone, otherwise type false to use the time zone found in the logs. The default setting is false.
127127
- `default_date_formats` - (Optional) Define the format for the timestamps present in your log messages. You can specify a locator regex to identify where timestamps appear in log lines. Requires 'automatic_date_parsing' set to True.
128128
+ `format` - (Required) The timestamp format supplied as a Java SimpleDateFormat, or "epoch" if the timestamp is in epoch format.
129-
+ `locator` - (Optional) Regular expression to locate the timestamp within the messages.
129+
+ `locator` - (Optional) Regular expression to locate the timestamp within the messages.
130130

131131
Usage:
132132
```hcl
@@ -155,6 +155,7 @@ The following properties are common to ALL sources and can be used to configure
155155
mask = "MaskedID"
156156
}
157157
```
158+
- `hash_algorithm` - (Optional) Define the hash algorithm used for Hash type filters. Available values are "MD5" and "SHA-256". The default value will be "MD5".
158159
- `cutoff_timestamp` - (Optional) Only collect data more recent than this timestamp, specified as milliseconds since epoch (13 digit). This maps to the `Collection should begin` field on the UI. Example: using `1663786159000` will set the cutoff timestamp to `Wednesday, September 21, 2022 6:49:19 PM GMT`
159160
- `cutoff_relative_time` - (Optional) Can be specified instead of cutoffTimestamp to provide a relative offset with respect to the current time.This maps to the `Collection should begin` field on the UI. Example: use -1h, -1d, or -1w to collect data that's less than one hour, one day, or one week old, respectively.
160161
- `fields` - (Optional) Map containing key/value pairs.

website/docs/r/data_forwarding_destination.html.markdown

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ Provider to manage [Sumologic Data Forwarding Destination](https://help.sumologi
1212
```hcl
1313
resource "sumologic_data_forwarding_destination" "example_data_forwarding_destination" {
1414
destination_name = "df-destination"
15-
description = ""
15+
description = "some description"
1616
bucket_name = "df-bucket"
17-
region = "us-east-1"
18-
authentication_mode = "RoleBased"
19-
access_key_id = "accessKeyId"
20-
secret_access_key = "secretAccessKey"
21-
role_arn = "arn:aws:iam::some-valid-arn"
22-
encrypted = "false"
17+
s3_region = "us-east-1"
18+
authentication {
19+
type = "RoleBased"
20+
role_arn = "arn:aws:iam::your_arn"
21+
# access_key = "your access key"
22+
# secret_key = "your secret key"
23+
}
24+
s3_server_side_encryption = false
25+
enabled = true
2326
}
2427
```
2528
## Argument reference
@@ -29,12 +32,13 @@ The following arguments are supported:
2932
- `destination_name` - (Required) Name of the S3 data forwarding destination.
3033
- `description` - (Optional) Description of the S3 data forwarding destination.
3134
- `bucket_name` - (Required) The name of the Amazon S3 bucket.
32-
- `region` - (Optional) The region where the S3 bucket is located.
33-
- `authentication_mode` - (Required) AWS IAM authentication method used for access. Possible values are: 1. `AccessKey` 2. `RoleBased`
34-
- `access_key_id` - (Optional) The AWS Access ID to access the S3 bucket.
35-
- `secret_access_key` - (Optional) The AWS Secret Key to access the S3 bucket.
35+
- `s3_region` - (Optional) The region where the S3 bucket is located.
36+
- `type` - (Required) AWS IAM authentication method used for access. Possible values are: 1. `AccessKey` 2. `RoleBased`
37+
- `access_key` - (Optional) The AWS Access ID to access the S3 bucket.
38+
- `secret_key` - (Optional) The AWS Secret Key to access the S3 bucket.
3639
- `role_arn` - (Optional) The AWS Role ARN to access the S3 bucket.
37-
- `encrypted` - (Optional) Enable S3 server-side encryption.
40+
- `s3_server_side_encryption` - (Optional) Enable S3 server-side encryption.
41+
- `enabled` - (Optional) True when the data forwarding destination is enabled. Will be treated as _false_ if left blank.
3842

3943
The following attributes are exported:
4044

0 commit comments

Comments
 (0)