Skip to content

Commit 93e440b

Browse files
authored
add region parameter in polling source auth (#277)
1 parent d3f03b5 commit 93e440b

8 files changed

+18
-0
lines changed

sumologic/resource_sumologic_generic_polling_source.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func resourceSumologicGenericPollingSource() *schema.Resource {
6363
Type: schema.TypeString,
6464
Optional: true,
6565
},
66+
"region": {
67+
Type: schema.TypeString,
68+
Optional: true,
69+
},
6670
},
6771
},
6872
}
@@ -270,6 +274,7 @@ func getPollingThirdPartyAuthenticationAttributes(pollingResource []PollingResou
270274
"access_key": t.Authentication.AwsID,
271275
"secret_key": t.Authentication.AwsKey,
272276
"role_arn": t.Authentication.RoleARN,
277+
"region": t.Authentication.Region,
273278
}
274279
s = append(s, mapping)
275280
}
@@ -329,9 +334,15 @@ func getPollingAuthentication(d *schema.ResourceData) (PollingAuthentication, er
329334
authSettings.Type = "S3BucketAuthentication"
330335
authSettings.AwsID = auth["access_key"].(string)
331336
authSettings.AwsKey = auth["secret_key"].(string)
337+
if auth["region"] != nil {
338+
authSettings.Region = auth["region"].(string)
339+
}
332340
case "AWSRoleBasedAuthentication":
333341
authSettings.Type = "AWSRoleBasedAuthentication"
334342
authSettings.RoleARN = auth["role_arn"].(string)
343+
if auth["region"] != nil {
344+
authSettings.Region = auth["region"].(string)
345+
}
335346
default:
336347
errorMessage := fmt.Sprintf("[ERROR] Unknown authType: %v", authType)
337348
log.Print(errorMessage)

sumologic/sumologic_polling_source.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type PollingAuthentication struct {
2929
AwsID string `json:"awsId"`
3030
AwsKey string `json:"awsKey"`
3131
RoleARN string `json:"roleARN"`
32+
Region string `json:"region,omitempty"`
3233
}
3334

3435
type PollingPath struct {

website/docs/r/cloudfront_source.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ In addition to the common properties, the following arguments are supported:
5353
+ `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication`
5454
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`
5555
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`
56+
+ `region` - (Optional) Your AWS Bucket region.
5657
- `path` - (Required) The location to scan for new data.
5758
+ `type` - (Required) type of polling source. This has to be `S3BucketPathExpression` for `CloudFront` source.
5859
+ `bucket_name` - (Required) The name of the bucket. This is needed if using type `S3BucketPathExpression`.

website/docs/r/cloudtrail_source.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ In addition to the common properties, the following arguments are supported:
5353
+ `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication`
5454
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`
5555
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`
56+
+ `region` - (Optional) Your AWS Bucket region.
5657
- `path` - (Required) The location to scan for new data.
5758
+ `type` - (Required) type of polling source. This has to be `S3BucketPathExpression` for `CloudTrail` source.
5859
+ `bucket_name` - (Required) The name of the bucket.

website/docs/r/cloudwatch_source.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ In addition to the common properties, the following arguments are supported:
8282
+ `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication`
8383
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`
8484
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`
85+
+ `region` - (Optional) Your AWS Bucket region.
8586
- `path` - (Required) The location to scan for new data.
8687
+ `type` - (Required) type of polling source. This has to be `CloudWatchPath` for CloudWatch source.
8788
+ `limit_to_regions` - (Optional) List of Amazon regions.

website/docs/r/elb_source.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ In addition to the common properties, the following arguments are supported:
5353
+ `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication`.
5454
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`.
5555
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`.
56+
+ `region` - (Optional) Your AWS Bucket region.
5657
- `path` - (Required) The location to scan for new data.
5758
+ `type` - (Required) type of polling source. This has to be `S3BucketPathExpression` for `ELB` source.
5859
+ `bucket_name` - (Required) The name of the bucket.

website/docs/r/s3_audit_source.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ In addition to the common properties, the following arguments are supported:
5353
+ `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication`.
5454
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`.
5555
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`.
56+
+ `region` - (Optional) Your AWS Bucket region.
5657
- `path` - (Required) The location to scan for new data.
5758
+ `type` - (Required) type of polling source. This has to be `S3BucketPathExpression` for `S3 Audit source`.
5859
+ `bucket_name` - (Required) The name of the bucket.

website/docs/r/s3_source.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ In addition to the common properties, the following arguments are supported:
5353
+ `access_key` - (Required) Your AWS access key if using type `S3BucketAuthentication`.
5454
+ `secret_key` - (Required) Your AWS secret key if using type `S3BucketAuthentication`.
5555
+ `role_arn` - (Required) Your AWS role ARN if using type `AWSRoleBasedAuthentication`.
56+
+ `region` - (Optional) Your AWS Bucket region.
5657
- `path` - (Required) The location to scan for new data.
5758
+ `type` - (Required) type of polling source. This has to be `S3BucketPathExpression` for `S3 source`.
5859
+ `bucket_name` - (Required) The name of the bucket.

0 commit comments

Comments
 (0)