@@ -190,6 +190,7 @@ func DataSourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{})
190190 }
191191 if _ , ok := d .GetOk ("name" ); ok {
192192 name := d .Get ("name" ).(string )
193+
193194 resourceInstanceListOptions := rc.ListResourceInstancesOptions {
194195 Name : & name ,
195196 }
@@ -302,12 +303,17 @@ func DataSourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{})
302303
303304 ID : instance .ResourceID ,
304305 }
305- service , _ , err := globalClient .GetCatalogEntry (& options )
306- if err != nil {
307- return fmt .Errorf ("[ERROR] Error retrieving service offering: %s" , err )
308- }
309306
310- d .Set ("service" , service .Name )
307+ // Note: Once the Compliance service (SCC) reaches its end of life, this conditional check can be revisited or safely removed.
308+ if * instance .ResourceID == "compliance" {
309+ d .Set ("service" , "compliance" )
310+ } else {
311+ service , _ , err := globalClient .GetCatalogEntry (& options )
312+ if err != nil {
313+ return fmt .Errorf ("[ERROR] Error retrieving service offering: %s" , err )
314+ }
315+ d .Set ("service" , service .Name )
316+ }
311317
312318 d .Set (flex .ResourceName , instance .Name )
313319 d .Set (flex .ResourceCRN , instance .CRN )
@@ -354,11 +360,18 @@ func DataSourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{})
354360
355361 ID : instance .ResourcePlanID ,
356362 }
357- plan , _ , err := globalClient .GetCatalogEntry (& planOptions )
358- if err != nil {
359- return fmt .Errorf ("[ERROR] Error retrieving plan: %s" , err )
363+
364+ // Note: Once the Compliance service (SCC) reaches its end of life, this conditional check can be revisited or safely removed.
365+ if * instance .ResourceID == "compliance" {
366+ d .Set ("plan" , "security-compliance-center-standard-plan" )
367+ } else {
368+ plan , _ , err := globalClient .GetCatalogEntry (& planOptions )
369+ if err != nil {
370+ return fmt .Errorf ("[ERROR] Error retrieving plan: %s" , err )
371+ }
372+ d .Set ("plan" , plan .Name )
360373 }
361- d . Set ( "plan" , plan . Name )
374+
362375 d .Set ("crn" , instance .CRN )
363376 tags , err := flex .GetTagsUsingCRN (meta , * instance .CRN )
364377 if err != nil {
0 commit comments