Skip to content

Commit 9d5a7f1

Browse files
committed
add docs
1 parent 7abce1c commit 9d5a7f1

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

website/docs/r/polling_source.html.markdown

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,20 @@ locals {
1717
name = "Exclude Comments"
1818
filter_type = "Exclude"
1919
regexp = "#.*"
20-
}]
20+
}]
21+
tagfilters = [{
22+
"type" = "TagFilters"
23+
"namespace" = "All"
24+
"tags" = ["k3=v3"]
25+
},{
26+
"type" = "TagFilters"
27+
"namespace" = "AWS/Route53"
28+
"tags" = ["k1=v1"]
29+
},{
30+
"type" = "TagFilters"
31+
"namespace" = "AWS/S3"
32+
"tags" = ["k2=v2"]
33+
}]
2134
}
2235
2336
resource "sumologic_polling_source" "s3_audit" {
@@ -31,16 +44,49 @@ resource "sumologic_polling_source" "s3_audit" {
3144
filters = "${local.filters}"
3245
3346
authentication {
47+
type = " S3BucketAuthentication"
3448
access_key = "someKey"
3549
secret_key = "******"
3650
}
3751
3852
path {
53+
type = "S3BucketPathExpression"
3954
bucket_name = "Bucket1"
4055
path_expression = "*"
4156
}
4257
}
4358
59+
resource "sumologic_polling_source" "terraform_cw_metrics" {
60+
name = "Terraform CW Metrics"
61+
description = "My description"
62+
category = "aws/terraform_cw"
63+
content_type = "AwsCloudWatch"
64+
scan_interval = 300000
65+
paused = false
66+
collector_id = "${sumologic_collector.collector.id}"
67+
68+
authentication {
69+
type = "AWSRoleBasedAuthentication"
70+
role_arn = "arn:aws:iam::604066827510:role/cw-role-SumoRole-4AOLS73TGKYI"
71+
}
72+
73+
path {
74+
type = "CloudWatchPath"
75+
limit_to_regions = ["us-west-2"]
76+
limit_to_namespaces = ["AWS/Route53","AWS/S3","customNamepace"]
77+
78+
dynamic "tag_filters" {
79+
for_each = local.filters
80+
content{
81+
type = tag_filters.value.type
82+
namespace = tag_filters.value.namespace
83+
tags = tag_filters.value.tags
84+
}
85+
}
86+
87+
}
88+
}
89+
4490
resource "sumologic_collector" "collector" {
4591
name = "my-collector"
4692
description = "Just testing this"
@@ -60,8 +106,16 @@ In addition to the common properties, the following arguments are supported:
60106
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`
61107
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`
62108
- `path` - (Required) The location to scan for new data.
63-
+ `bucket_name` - (Required) The name of the bucket.
64-
+ `path_expression` - (Required) The path to the data.
109+
+ `type` - (Required) type of polling source. Can be one of `S3BucketPathExpression` or `CloudWatchPath`
110+
+ `bucket_name` - (Optional) The name of the bucket. This is needed if using type `S3BucketPathExpression`.
111+
+ `path_expression` - (Optional) The path to the data. This is needed if using type `S3BucketPathExpression`.
112+
+ `limit_to_regions` - (Optional) List of Amazon regions to limit metricscollection. This is a valid parameter if using type `CloudWatchPath`.
113+
+ `limit_to_namespaces` - (Optional) List of namespaces to limit metrics collection. By default all namespaces are selected. Details can be found [here](https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/Amazon-Web-Services/Amazon-CloudWatch-Source-for-Metrics#aws%C2%A0tag-filtering-namespace-support). You can also specify custom namespace. This is a valid parameter if using type `CloudWatchPath`.
114+
+ `tag_filters` - (Optional) Tag filters allow you to filter the CloudWatch metrics you collect by the AWS tags you have assigned to your AWS resources. You can define tag filters for each supported namespace. If you do not define any tag filters, all metrics will be collected for the regions and namespaces you configured for the source above. This is a valid parameter if using type `CloudWatchPath` More info on tag filters can be found [here](https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/Amazon-Web-Services/Amazon-CloudWatch-Source-for-Metrics#about-aws-tag-filtering)
115+
+ `type` - This value has to be set to `TagFilters`
116+
+ `namespace` - Namespace for which you want to define the tag filters. Use value as `All` to apply the tag filter for all namespaces.
117+
+ `tags` - List of key-value pairs of tag filters. Eg: `["k3=v3"]`
118+
65119

66120
The following attributes are exported:
67121

0 commit comments

Comments
 (0)