Skip to content

Commit 165de28

Browse files
committed
Merge branch 'master' into avijit-release-trigger-conditions-and-deprecate-triggers
2 parents 0fb65fc + 93e440b commit 165de28

27 files changed

+876
-110
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ jobs:
8282
SUMOLOGIC_ACCESSID: ${{ secrets.SUMOLOGIC_ACCESSID }}
8383
SUMOLOGIC_ACCESSKEY: ${{ secrets.SUMOLOGIC_ACCESSKEY }}
8484
SUMOLOGIC_ENVIRONMENT: ${{ secrets.SUMOLOGIC_ENVIRONMENT }}
85-
SUMOLOGIC_TEST_AWS_ID: ${{ secrets.SUMOLOGIC_TEST_AWS_ID }}
86-
SUMOLOGIC_TEST_AWS_KEY: ${{ secrets.SUMOLOGIC_TEST_AWS_KEY }}
8785
SUMOLOGIC_TEST_BUCKET_NAME: ${{ secrets.SUMOLOGIC_TEST_BUCKET_NAME }}
86+
SUMOLOGIC_TEST_ROLE_ARN: ${{ secrets.SUMOLOGIC_TEST_ROLE_ARN }}
8887

8988
run: |
9089
go test -v -cover ./sumologic/

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
## 2.9.11 (Unreleased)
1+
## 2.10.0 (Unreleased)
22

3+
FEATURES:
4+
5+
* **New Resource:** sumologic_hierarchy (GH-260)
36
DEPRECATIONS:
47

58
* resource/sumologic_monitor: Deprecated `triggers` in favor of `trigger_conditions` (GH-267)

sumologic/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func Provider() terraform.ResourceProvider {
7575
"sumologic_kinesis_metrics_source": resourceSumologicKinesisMetricsSource(),
7676
"sumologic_token": resourceSumologicToken(),
7777
"sumologic_policies": resourceSumologicPolicies(),
78+
"sumologic_hierarchy": resourceSumologicHierarchy(),
7879
},
7980
DataSourcesMap: map[string]*schema.Resource{
8081
"sumologic_admin_recommended_folder": dataSourceSumologicAdminRecommendedFolder(),

sumologic/provider_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ func testAccPreCheck(t *testing.T) {
4242

4343
func testAccPreCheckWithAWS(t *testing.T) {
4444
testAccPreCheck(t)
45-
if v := os.Getenv("SUMOLOGIC_TEST_AWS_ID"); v == "" {
46-
t.Fatal("SUMOLOGIC_TEST_AWS_ID must be set for polling source acceptance tests")
47-
}
48-
if v := os.Getenv("SUMOLOGIC_TEST_AWS_KEY"); v == "" {
49-
t.Fatal("SUMOLOGIC_TEST_AWS_KEY must be set for polling source acceptance tests")
45+
if v := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN"); v == "" {
46+
t.Fatal("SUMOLOGIC_TEST_ROLE_ARN must be set for polling source acceptance tests")
5047
}
5148
if v := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME"); v == "" {
5249
t.Fatal("SUMOLOGIC_TEST_BUCKET_NAME must be set for polling source acceptance tests")

sumologic/resource_sumologic_cloudfront_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ func TestAccSumologicCloudFrontSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
cloudFrontResourceName := "sumologic_cloudfront_source.cloudfront"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
2221
resource.Test(t, resource.TestCase{
2322
PreCheck: func() { testAccPreCheckWithAWS(t) },
2423
Providers: testAccProviders,
2524
CheckDestroy: testAccCheckCloudFrontSourceDestroy,
2625
Steps: []resource.TestStep{
2726
{
28-
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
27+
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
2928
Check: resource.ComposeTestCheckFunc(
3029
testAccCheckCloudFrontSourceExists(cloudFrontResourceName, &cloudFrontSource),
3130
testAccCheckCloudFrontSourceValues(&cloudFrontSource, sName, sDescription, sCategory),
@@ -48,16 +47,15 @@ func TestAccSumologicCloudFrontSource_update(t *testing.T) {
4847
sName, sDescription, sCategory := getRandomizedParams()
4948
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
5049
cloudFrontResourceName := "sumologic_cloudfront_source.cloudfront"
51-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
52-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
50+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5351
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
5452
resource.Test(t, resource.TestCase{
5553
PreCheck: func() { testAccPreCheckWithAWS(t) },
5654
Providers: testAccProviders,
5755
CheckDestroy: testAccCheckHTTPSourceDestroy,
5856
Steps: []resource.TestStep{
5957
{
60-
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
58+
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
6159
Check: resource.ComposeTestCheckFunc(
6260
testAccCheckCloudFrontSourceExists(cloudFrontResourceName, &cloudFrontSource),
6361
testAccCheckCloudFrontSourceValues(&cloudFrontSource, sName, sDescription, sCategory),
@@ -70,7 +68,7 @@ func TestAccSumologicCloudFrontSource_update(t *testing.T) {
7068
),
7169
},
7270
{
73-
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey, testAwsBucket),
71+
Config: testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn, testAwsBucket),
7472
Check: resource.ComposeTestCheckFunc(
7573
testAccCheckCloudFrontSourceExists(cloudFrontResourceName, &cloudFrontSource),
7674
testAccCheckCloudFrontSourceValues(&cloudFrontSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -152,7 +150,7 @@ func testAccCheckCloudFrontSourceValues(pollingSource *PollingSource, name, desc
152150
return nil
153151
}
154152
}
155-
func testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket string) string {
153+
func testAccSumologicCloudFrontSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket string) string {
156154
return fmt.Sprintf(`
157155
resource "sumologic_collector" "test" {
158156
name = "%s"
@@ -168,9 +166,8 @@ resource "sumologic_cloudfront_source" "cloudfront" {
168166
paused = false
169167
collector_id = "${sumologic_collector.test.id}"
170168
authentication {
171-
type = "S3BucketAuthentication"
172-
access_key = "%s"
173-
secret_key = "%s"
169+
type = "AWSRoleBasedAuthentication"
170+
role_arn = "%s"
174171
}
175172
path {
176173
type = "S3BucketPathExpression"
@@ -179,5 +176,5 @@ resource "sumologic_cloudfront_source" "cloudfront" {
179176
}
180177
}
181178
182-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket)
179+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket)
183180
}

sumologic/resource_sumologic_cloudtrail_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ func TestAccSumologicCloudTrailSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
cloudTrailResourceName := "sumologic_cloudtrail_source.cloudtrail"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
2221
resource.Test(t, resource.TestCase{
2322
PreCheck: func() { testAccPreCheckWithAWS(t) },
2423
Providers: testAccProviders,
2524
CheckDestroy: testAccCheckCloudTrailSourceDestroy,
2625
Steps: []resource.TestStep{
2726
{
28-
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
27+
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
2928
Check: resource.ComposeTestCheckFunc(
3029
testAccCheckCloudTrailSourceExists(cloudTrailResourceName, &cloudTrailSource),
3130
testAccCheckCloudTrailSourceValues(&cloudTrailSource, sName, sDescription, sCategory),
@@ -48,16 +47,15 @@ func TestAccSumologicCloudTrailSource_update(t *testing.T) {
4847
sName, sDescription, sCategory := getRandomizedParams()
4948
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
5049
cloudTrailResourceName := "sumologic_cloudtrail_source.cloudtrail"
51-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
52-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
50+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5351
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
5452
resource.Test(t, resource.TestCase{
5553
PreCheck: func() { testAccPreCheckWithAWS(t) },
5654
Providers: testAccProviders,
5755
CheckDestroy: testAccCheckHTTPSourceDestroy,
5856
Steps: []resource.TestStep{
5957
{
60-
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
58+
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
6159
Check: resource.ComposeTestCheckFunc(
6260
testAccCheckCloudTrailSourceExists(cloudTrailResourceName, &cloudTrailSource),
6361
testAccCheckCloudTrailSourceValues(&cloudTrailSource, sName, sDescription, sCategory),
@@ -70,7 +68,7 @@ func TestAccSumologicCloudTrailSource_update(t *testing.T) {
7068
),
7169
},
7270
{
73-
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey, testAwsBucket),
71+
Config: testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn, testAwsBucket),
7472
Check: resource.ComposeTestCheckFunc(
7573
testAccCheckCloudTrailSourceExists(cloudTrailResourceName, &cloudTrailSource),
7674
testAccCheckCloudTrailSourceValues(&cloudTrailSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -152,7 +150,7 @@ func testAccCheckCloudTrailSourceValues(pollingSource *PollingSource, name, desc
152150
return nil
153151
}
154152
}
155-
func testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket string) string {
153+
func testAccSumologicCloudTrailSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket string) string {
156154
return fmt.Sprintf(`
157155
resource "sumologic_collector" "test" {
158156
name = "%s"
@@ -168,9 +166,8 @@ resource "sumologic_cloudtrail_source" "cloudtrail" {
168166
paused = false
169167
collector_id = "${sumologic_collector.test.id}"
170168
authentication {
171-
type = "S3BucketAuthentication"
172-
access_key = "%s"
173-
secret_key = "%s"
169+
type = "AWSRoleBasedAuthentication"
170+
role_arn = "%s"
174171
}
175172
path {
176173
type = "S3BucketPathExpression"
@@ -179,5 +176,5 @@ resource "sumologic_cloudtrail_source" "cloudtrail" {
179176
}
180177
}
181178
182-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket)
179+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket)
183180
}

sumologic/resource_sumologic_cloudwatch_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ func TestAccSumologicCloudWatchSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
cloudWatchResourceName := "sumologic_cloudwatch_source.cloudwatch"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
resource.Test(t, resource.TestCase{
2221
PreCheck: func() { testAccPreCheckWithAWS(t) },
2322
Providers: testAccProviders,
2423
CheckDestroy: testAccCheckCloudWatchSourceDestroy,
2524
Steps: []resource.TestStep{
2625
{
27-
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey),
26+
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn),
2827
Check: resource.ComposeTestCheckFunc(
2928
testAccCheckCloudWatchSourceExists(cloudWatchResourceName, &cloudWatchSource),
3029
testAccCheckCloudWatchSourceValues(&cloudWatchSource, sName, sDescription, sCategory),
@@ -47,15 +46,14 @@ func TestAccSumologicCloudWatchSource_update(t *testing.T) {
4746
sName, sDescription, sCategory := getRandomizedParams()
4847
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
4948
cloudWatchResourceName := "sumologic_cloudwatch_source.cloudwatch"
50-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
51-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
49+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5250
resource.Test(t, resource.TestCase{
5351
PreCheck: func() { testAccPreCheckWithAWS(t) },
5452
Providers: testAccProviders,
5553
CheckDestroy: testAccCheckHTTPSourceDestroy,
5654
Steps: []resource.TestStep{
5755
{
58-
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey),
56+
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn),
5957
Check: resource.ComposeTestCheckFunc(
6058
testAccCheckCloudWatchSourceExists(cloudWatchResourceName, &cloudWatchSource),
6159
testAccCheckCloudWatchSourceValues(&cloudWatchSource, sName, sDescription, sCategory),
@@ -68,7 +66,7 @@ func TestAccSumologicCloudWatchSource_update(t *testing.T) {
6866
),
6967
},
7068
{
71-
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey),
69+
Config: testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn),
7270
Check: resource.ComposeTestCheckFunc(
7371
testAccCheckCloudWatchSourceExists(cloudWatchResourceName, &cloudWatchSource),
7472
testAccCheckCloudWatchSourceValues(&cloudWatchSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -150,7 +148,7 @@ func testAccCheckCloudWatchSourceValues(pollingSource *PollingSource, name, desc
150148
return nil
151149
}
152150
}
153-
func testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsId, testAwsKey string) string {
151+
func testAccSumologicCloudWatchSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn string) string {
154152
return fmt.Sprintf(`
155153
resource "sumologic_collector" "test" {
156154
name = "%s"
@@ -167,9 +165,8 @@ resource "sumologic_cloudwatch_source" "cloudwatch" {
167165
paused = false
168166
collector_id = "${sumologic_collector.test.id}"
169167
authentication {
170-
type = "S3BucketAuthentication"
171-
access_key = "%s"
172-
secret_key = "%s"
168+
type = "AWSRoleBasedAuthentication"
169+
role_arn = "%s"
173170
}
174171
path {
175172
type = "CloudWatchPath"
@@ -187,5 +184,5 @@ resource "sumologic_cloudwatch_source" "cloudwatch" {
187184
}
188185
}
189186
}
190-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsId, testAwsKey)
187+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn)
191188
}

sumologic/resource_sumologic_dashboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func resourceSumologicDashboard() *schema.Resource {
9494
"refresh_interval": {
9595
Type: schema.TypeInt,
9696
Optional: true,
97-
ValidateFunc: validation.IntAtLeast(0),
97+
ValidateFunc: validation.IntInSlice([]int{120, 300, 900, 1800, 3600, 7200, 86400}),
9898
},
9999
"time_range": {
100100
Type: schema.TypeList,

sumologic/resource_sumologic_dashboard_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestAccSumologicDashboard_create(t *testing.T) {
4040
title := "terraform_test_dashboard_" + testNameSuffix
4141
description := "Test dashboard description"
4242
theme := "Dark"
43-
refreshInterval := 30
43+
refreshInterval := 120
4444
topologyLabel := "service"
4545
topologyLabelValue := "collection-proxy"
4646
literalRangeName := "today"
@@ -123,7 +123,7 @@ func TestAccSumologicDashboard_update(t *testing.T) {
123123
title := "terraform_test_dashboard_" + testNameSuffix
124124
description := "Test dashboard description"
125125
theme := "Dark"
126-
refreshInterval := 30
126+
refreshInterval := 120
127127
topologyLabel := "service"
128128
topologyLabelValue := "collection-proxy"
129129
literalRangeName := "today"
@@ -154,7 +154,7 @@ func TestAccSumologicDashboard_update(t *testing.T) {
154154

155155
// updated config
156156
newTheme := "Light"
157-
newRefreshInterval := 60
157+
newRefreshInterval := 300
158158
newTopologyLabelValue := "collection-cluster"
159159
newLiteralRangeName := "week"
160160
searchPanel := SumoSearchPanel{

sumologic/resource_sumologic_elb_source_test.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ func TestAccSumologicElbSource_create(t *testing.T) {
1616
cName, cDescription, cCategory := getRandomizedParams()
1717
sName, sDescription, sCategory := getRandomizedParams()
1818
elbResourceName := "sumologic_elb_source.elb"
19-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
20-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
19+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
2120
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
2221
resource.Test(t, resource.TestCase{
2322
PreCheck: func() { testAccPreCheckWithAWS(t) },
2423
Providers: testAccProviders,
2524
CheckDestroy: testAccCheckElbSourceDestroy,
2625
Steps: []resource.TestStep{
2726
{
28-
Config: testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
27+
Config: testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
2928
Check: resource.ComposeTestCheckFunc(
3029
testAccCheckElbSourceExists(elbResourceName, &elbSource),
3130
testAccCheckElbSourceValues(&elbSource, sName, sDescription, sCategory),
@@ -48,16 +47,15 @@ func TestAccSumologicElbSource_update(t *testing.T) {
4847
sName, sDescription, sCategory := getRandomizedParams()
4948
sNameUpdated, sDescriptionUpdated, sCategoryUpdated := getRandomizedParams()
5049
elbResourceName := "sumologic_elb_source.elb"
51-
testAwsID := os.Getenv("SUMOLOGIC_TEST_AWS_ID")
52-
testAwsKey := os.Getenv("SUMOLOGIC_TEST_AWS_KEY")
50+
testAwsRoleArn := os.Getenv("SUMOLOGIC_TEST_ROLE_ARN")
5351
testAwsBucket := os.Getenv("SUMOLOGIC_TEST_BUCKET_NAME")
5452
resource.Test(t, resource.TestCase{
5553
PreCheck: func() { testAccPreCheckWithAWS(t) },
5654
Providers: testAccProviders,
5755
CheckDestroy: testAccCheckHTTPSourceDestroy,
5856
Steps: []resource.TestStep{
5957
{
60-
Config: testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket),
58+
Config: testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket),
6159
Check: resource.ComposeTestCheckFunc(
6260
testAccCheckElbSourceExists(elbResourceName, &elbSource),
6361
testAccCheckElbSourceValues(&elbSource, sName, sDescription, sCategory),
@@ -70,7 +68,7 @@ func TestAccSumologicElbSource_update(t *testing.T) {
7068
),
7169
},
7270
{
73-
Config: testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsID, testAwsKey, testAwsBucket),
71+
Config: testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sNameUpdated, sDescriptionUpdated, sCategoryUpdated, testAwsRoleArn, testAwsBucket),
7472
Check: resource.ComposeTestCheckFunc(
7573
testAccCheckElbSourceExists(elbResourceName, &elbSource),
7674
testAccCheckElbSourceValues(&elbSource, sNameUpdated, sDescriptionUpdated, sCategoryUpdated),
@@ -152,7 +150,7 @@ func testAccCheckElbSourceValues(pollingSource *PollingSource, name, description
152150
return nil
153151
}
154152
}
155-
func testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket string) string {
153+
func testAccSumologicElbSourceConfig(cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket string) string {
156154
return fmt.Sprintf(`
157155
resource "sumologic_collector" "test" {
158156
name = "%s"
@@ -168,9 +166,8 @@ resource "sumologic_elb_source" "elb" {
168166
paused = false
169167
collector_id = "${sumologic_collector.test.id}"
170168
authentication {
171-
type = "S3BucketAuthentication"
172-
access_key = "%s"
173-
secret_key = "%s"
169+
type = "AWSRoleBasedAuthentication"
170+
role_arn = "%s"
174171
}
175172
path {
176173
type = "S3BucketPathExpression"
@@ -179,5 +176,5 @@ resource "sumologic_elb_source" "elb" {
179176
}
180177
}
181178
182-
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsID, testAwsKey, testAwsBucket)
179+
`, cName, cDescription, cCategory, sName, sDescription, sCategory, testAwsRoleArn, testAwsBucket)
183180
}

0 commit comments

Comments
 (0)