@@ -418,6 +418,11 @@ func ResourceIbmBackupRecoverySourceRegistration() *schema.Resource {
418418 },
419419 },
420420 },
421+ "auto_proetction_group_id" : & schema.Schema {
422+ Type : schema .TypeString ,
423+ Computed : true ,
424+ Description : "The user specified name for this source." ,
425+ },
421426 "source_id" : & schema.Schema {
422427 Type : schema .TypeInt ,
423428 Computed : true ,
@@ -1441,6 +1446,16 @@ func resourceIbmBackupRecoverySourceRegistrationCreate(context context.Context,
14411446
14421447 registrationId := fmt .Sprintf ("%s::%s" , tenantId , strconv .Itoa (int (* sourceRegistrationReponseParams .ID )))
14431448 d .SetId (registrationId )
1449+
1450+ if sourceRegistrationReponseParams .KubernetesParams != nil && sourceRegistrationReponseParams .KubernetesParams .AutoProtectConfig != nil && sourceRegistrationReponseParams .KubernetesParams .AutoProtectConfig .ProtectionGroupID != nil {
1451+
1452+ err := d .Set ("auto_proetction_group_id" , * sourceRegistrationReponseParams .KubernetesParams .AutoProtectConfig .ProtectionGroupID )
1453+ if err != nil {
1454+ tfErr := flex .TerraformErrorf (err , fmt .Sprintf ("RegisterProtectionSourceWithContext failed: %s" , err .Error ()), "ibm_backup_recovery_source_registration" , "create" )
1455+ log .Printf ("[DEBUG]\n %s" , tfErr .GetDebugMessage ())
1456+ return tfErr .GetDiag ()
1457+ }
1458+ }
14441459 return resourceIbmBackupRecoverySourceRegistrationRead (context , d , meta )
14451460}
14461461
@@ -1584,6 +1599,11 @@ func resourceIbmBackupRecoverySourceRegistrationRead(context context.Context, d
15841599 }
15851600 }
15861601 if ! core .IsNil (sourceRegistrationReponseParams .KubernetesParams ) {
1602+ group_id , ok := d .GetOk ("auto_proetction_group_id" )
1603+ if ok && group_id .(string ) != "" {
1604+ autoProetctionGroupId := group_id .(string )
1605+ sourceRegistrationReponseParams .KubernetesParams .AutoProtectConfig .ProtectionGroupID = & autoProetctionGroupId
1606+ }
15871607 kubernetesParamsMap , err := ResourceIbmBackupRecoverySourceRegistrationKubernetesSourceRegistrationParamsToMap (sourceRegistrationReponseParams .KubernetesParams )
15881608 if err != nil {
15891609 return flex .DiscriminatedTerraformErrorf (err , err .Error (), "ibm_backup_recovery_source_registration" , "read" , "kubernetes_params-to-map" ).GetDiag ()
0 commit comments