@@ -37,7 +37,6 @@ func resourceSumologicKinesisMetricsSource() *schema.Resource {
3737 kinesisMetricsSource .Schema ["authentication" ] = & schema.Schema {
3838 Type : schema .TypeList ,
3939 Required : true ,
40- ForceNew : true ,
4140 MinItems : 1 ,
4241 MaxItems : 1 ,
4342 Elem : & schema.Resource {
@@ -66,7 +65,6 @@ func resourceSumologicKinesisMetricsSource() *schema.Resource {
6665 kinesisMetricsSource .Schema ["path" ] = & schema.Schema {
6766 Type : schema .TypeList ,
6867 Required : true ,
69- ForceNew : true ,
7068 MinItems : 1 ,
7169 MaxItems : 1 ,
7270 Elem : & schema.Resource {
@@ -163,12 +161,17 @@ func resourceSumologicKinesisMetricsSourceRead(d *schema.ResourceData, meta inte
163161 }
164162
165163 kinesisMetricsResources := source .ThirdPartyRef .Resources
164+ auth := getKinesisMetricsThirdPartyAuth (kinesisMetricsResources )
166165 path := getKinesisMetricsThirdPartyPathAttributes (kinesisMetricsResources )
167166
168167 if err := d .Set ("path" , path ); err != nil {
169168 return err
170169 }
171170
171+ if err := d .Set ("authentication" , auth ); err != nil {
172+ return err
173+ }
174+
172175 if err := resourceSumologicSourceRead (d , source .Source ); err != nil {
173176 return fmt .Errorf ("%s" , err )
174177 }
@@ -237,3 +240,23 @@ func getKinesisMetricsThirdPartyPathAttributes(pollingResource []PollingResource
237240 }
238241 return s
239242}
243+
244+ func getKinesisMetricsThirdPartyAuth (pollingResource []PollingResource ) []map [string ]interface {} {
245+ auth := make (map [string ]interface {})
246+ pr := pollingResource [0 ]
247+ auth ["type" ] = pr .Authentication .Type
248+
249+ if pr .Authentication .AwsID != "" {
250+ auth ["access_key" ] = pr .Authentication .AwsID
251+ }
252+ if pr .Authentication .AwsKey != "" {
253+ auth ["secret_key" ] = pr .Authentication .AwsKey
254+ }
255+ if pr .Authentication .RoleARN != "" {
256+ auth ["role_arn" ] = pr .Authentication .RoleARN
257+ }
258+
259+ var authArrary []map [string ]interface {}
260+ authArrary = append (authArrary , auth )
261+ return authArrary
262+ }
0 commit comments