Skip to content

Commit 5242a88

Browse files
committed
Add tf support for Aws XRay source
1 parent 92f281c commit 5242a88

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

sumologic/resource_sumologic_polling_source.go

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ func resourceSumologicPollingSource() *schema.Resource {
1919
}
2020

2121
pollingSource.Schema["content_type"] = &schema.Schema{
22-
Type: schema.TypeString,
23-
Required: true,
24-
ForceNew: true,
25-
ValidateFunc: validation.StringInSlice([]string{"AwsS3Bucket", "AwsElbBucket", "AwsCloudFrontBucket", "AwsCloudTrailBucket", "AwsS3AuditBucket", "AwsCloudWatch"}, false),
22+
Type: schema.TypeString,
23+
Required: true,
24+
ForceNew: true,
25+
ValidateFunc: validation.StringInSlice([]string{"AwsS3Bucket", "AwsElbBucket", "AwsCloudFrontBucket",
26+
"AwsCloudTrailBucket", "AwsS3AuditBucket", "AwsCloudWatch", "AwsXRay"}, false),
2627
}
2728
pollingSource.Schema["scan_interval"] = &schema.Schema{
2829
Type: schema.TypeInt,
@@ -73,9 +74,10 @@ func resourceSumologicPollingSource() *schema.Resource {
7374
Elem: &schema.Resource{
7475
Schema: map[string]*schema.Schema{
7576
"type": {
76-
Type: schema.TypeString,
77-
Required: true,
78-
ValidateFunc: validation.StringInSlice([]string{"S3BucketPathExpression", "CloudWatchPath"}, false),
77+
Type: schema.TypeString,
78+
Required: true,
79+
ValidateFunc: validation.StringInSlice([]string{"S3BucketPathExpression", "CloudWatchPath",
80+
"AwsXRayPath"}, false),
7981
},
8082
"bucket_name": {
8183
Type: schema.TypeString,
@@ -327,6 +329,14 @@ func getPathSettings(d *schema.ResourceData) PollingPath {
327329
pathSettings.LimitToRegions = LimitToRegions
328330
pathSettings.LimitToNamespaces = LimitToNamespaces
329331
pathSettings.TagFilters = getTagFilters(d)
332+
case "AwsXRayPath":
333+
pathSettings.Type = "AwsXRayPath"
334+
rawLimitToRegions := path["limit_to_regions"].([]interface{})
335+
LimitToRegions := make([]string, len(rawLimitToRegions))
336+
for i, v := range rawLimitToRegions {
337+
LimitToRegions[i] = v.(string)
338+
}
339+
pathSettings.LimitToRegions = LimitToRegions
330340
default:
331341
log.Printf("[ERROR] Unknown resourceType in path: %v", pathType)
332342
}

0 commit comments

Comments
 (0)