Skip to content

Commit b5eb9df

Browse files
Terraform Team AutomationNagaRajuPasunuri
authored andcommitted
Added - Handle disassociate trigger for DR Protection Group
1 parent 017bec5 commit b5eb9df

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

internal/integrationtest/disaster_recovery_dr_protection_group_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ var (
4848
}
4949

5050
DisasterRecoveryDrProtectionGroupRepresentation = map[string]interface{}{
51-
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
52-
"display_name": acctest.Representation{RepType: acctest.Required, Create: `My DR Protection Group`, Update: `displayName2`},
53-
"log_location": acctest.RepresentationGroup{RepType: acctest.Required, Group: DisasterRecoveryDrProtectionGroupLogLocationRepresentation},
54-
"association": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DisasterRecoveryDrProtectionGroupAssociationRepresentation},
55-
"members": acctest.RepresentationGroup{RepType: acctest.Required, Group: DisasterRecoveryDrProtectionGroupMembersRepresentation},
56-
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
57-
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}},
58-
"lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DefinedTagsIgnoreRepresentation},
51+
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
52+
"display_name": acctest.Representation{RepType: acctest.Required, Create: `My DR Protection Group`, Update: `displayName2`},
53+
"log_location": acctest.RepresentationGroup{RepType: acctest.Required, Group: DisasterRecoveryDrProtectionGroupLogLocationRepresentation},
54+
"association": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DisasterRecoveryDrProtectionGroupAssociationRepresentation},
55+
"members": acctest.RepresentationGroup{RepType: acctest.Required, Group: DisasterRecoveryDrProtectionGroupMembersRepresentation},
56+
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
57+
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}},
58+
"lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DefinedTagsIgnoreRepresentation},
59+
"disassociate_trigger": acctest.Representation{RepType: acctest.Optional, Create: `0`},
5960
}
6061

6162
DisasterRecoveryPeerDrProtectionGroupRepresentation = map[string]interface{}{
@@ -420,6 +421,7 @@ func TestDisasterRecoveryDrProtectionGroupResource_basic(t *testing.T) {
420421
ImportStateVerify: true,
421422
ImportStateVerifyIgnore: []string{
422423
"association",
424+
"disassociate_trigger",
423425
},
424426
ResourceName: resourceName,
425427
},

internal/service/disaster_recovery/disaster_recovery_dr_protection_group_resource.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,6 @@ func createDisasterRecoveryDrProtectionGroup(d *schema.ResourceData, m interface
538538
return e
539539
}
540540

541-
if _, ok := sync.D.GetOkExists("disassociate_trigger"); ok {
542-
err := sync.DisassociateDrProtectionGroup()
543-
if err != nil {
544-
return err
545-
}
546-
}
547541
return nil
548542

549543
}

0 commit comments

Comments
 (0)