@@ -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 (`
157155resource "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}
0 commit comments