Skip to content

Commit 1d0a7a7

Browse files
authored
add use_versioned_api parameter for s3 source (#401)
* add use_versioned_api parameter for s3 source * fix default value * add new param in tests * remove default value
1 parent b5e9830 commit 1d0a7a7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

sumologic/resource_sumologic_generic_polling_source.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ func resourceSumologicGenericPollingSource() *schema.Resource {
125125
Type: schema.TypeString,
126126
Optional: true,
127127
},
128+
"use_versioned_api": {
129+
Type: schema.TypeBool,
130+
Optional: true,
131+
},
128132
"path_expression": {
129133
Type: schema.TypeString,
130134
Optional: true,
@@ -336,6 +340,7 @@ func getPollingThirdPartyPathAttributes(pollingResource []PollingResource) []map
336340
"limit_to_regions": t.Path.LimitToRegions,
337341
"limit_to_namespaces": t.Path.LimitToNamespaces,
338342
"limit_to_services": t.Path.LimitToServices,
343+
"use_versioned_api": t.Path.UseVersionedApi,
339344
"custom_services": flattenCustomServices(t.Path.CustomServices),
340345
"tag_filters": flattenPollingTagFilters(t.Path.TagFilters),
341346
"sns_topic_or_subscription_arn": flattenPollingSnsTopicOrSubscriptionArn(t.Path.SnsTopicOrSubscriptionArn),
@@ -572,6 +577,9 @@ func getPollingPathSettings(d *schema.ResourceData) (PollingPath, error) {
572577
pathSettings.Type = "S3BucketPathExpression"
573578
pathSettings.BucketName = path["bucket_name"].(string)
574579
pathSettings.PathExpression = path["path_expression"].(string)
580+
if path["use_versioned_api"] != nil {
581+
pathSettings.UseVersionedApi = path["use_versioned_api"].(bool)
582+
}
575583
pathSettings.SnsTopicOrSubscriptionArn = getPollingSnsTopicOrSubscriptionArn(d)
576584
case "CloudWatchPath", "AwsInventoryPath":
577585
pathSettings.Type = pathType

sumologic/sumologic_polling_source.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type PollingPath struct {
5151
CustomServices []string `json:"customServices,omitempty"`
5252
TagFilters []TagFilter `json:"tagFilters,omitempty"`
5353
SnsTopicOrSubscriptionArn PollingSnsTopicOrSubscriptionArn `json:"snsTopicOrSubscriptionArn,omitempty"`
54+
UseVersionedApi bool `json:"useVersionedApi,omitempty"`
5455
}
5556

5657
type TagFilter struct {

website/docs/r/s3_source.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ In addition to the [Common Source Properties](https://registry.terraform.io/prov
5959
+ `bucket_name` - (Required) The name of the bucket.
6060
+ `path_expression` - (Required) The path to the data.
6161
+ `sns_topic_or_subscription_arn` - (Computed) This is a computed field for SNS topic/subscription ARN.
62+
+ `use_versioned_api` - (Optional) Whether to Use AWS versioned APIs. Default is set to `true`. If you're collecting from a Cisco Umbrella bucket this must be set to `false`.
6263

6364
### See also
6465
* [Common Source Properties](https://registry.terraform.io/providers/SumoLogic/sumologic/latest/docs#common-source-properties)

0 commit comments

Comments
 (0)