terraform-provider-oci icon indicating copy to clipboard operation
terraform-provider-oci copied to clipboard

DR Protection Groups not associated at provisioning

Open bogdan-m-darie opened this issue 2 months ago • 3 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

$ terraform -v
Terraform v1.8.3
on linux_amd64
+ provider registry.terraform.io/oracle/oci v5.41.0

Affected Resource(s)

affected_resources = oci_disaster_recovery_dr_protection_group

Terraform Configuration Files

resource "oci_disaster_recovery_dr_protection_group" "test_peer" {
  compartment_id = var.compartment_id
  display_name   = var.dr_protection_group_display_name

  log_location {
    bucket    = "fra"
    namespace = "frvkqml7frsy"
  }
}

resource "oci_disaster_recovery_dr_protection_group" "test_dr_protection_group" {
  compartment_id = var.compartment_id
  display_name   = var.dr_protection_group_display_name

  log_location {
    bucket    = "fra"
    namespace = "frvkqml7frsy"
  }

  association {
    role        = var.dr_protection_group_association_role
    peer_id     = oci_disaster_recovery_dr_protection_group.test_peer.id
    peer_region = var.dr_protection_group_association_peer_region
  }

  disassociate_trigger = var.disassociate_trigger
}

Debug Output

$ terraform apply
data.oci_identity_availability_domains.test_availability_domains: Reading...
data.oci_identity_availability_domains.test_availability_domains: Read complete after 0s [id=IdentityAvailabilityDomainsDataSource-1916616763]
data.oci_core_volume_groups.test_volume_groups: Reading...
data.oci_core_volume_groups.test_volume_groups: Read complete after 0s [id=CoreVolumeGroupsDataSource-743146264]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # oci_disaster_recovery_dr_protection_group.test_dr_protection_group will be created
  + resource "oci_disaster_recovery_dr_protection_group" "test_dr_protection_group" {
      + compartment_id       = "ocid1.compartment.oc1..aaaaaaaahaz26fqhyi3fezbueousr53okuox7iayrmqik4hatmq6o3i3f35q"
      + defined_tags         = (known after apply)
      + disassociate_trigger = 0
      + display_name         = "displayName"
      + freeform_tags        = (known after apply)
      + id                   = (known after apply)
      + life_cycle_details   = (known after apply)
      + lifecycle_sub_state  = (known after apply)
      + peer_id              = (known after apply)
      + peer_region          = (known after apply)
      + role                 = (known after apply)
      + state                = (known after apply)
      + system_tags          = (known after apply)
      + time_created         = (known after apply)
      + time_updated         = (known after apply)

      + association {
          + peer_id     = (known after apply)
          + peer_region = "eu-frankfurt-1"
          + role        = "STANDBY"
        }

      + log_location {
          + bucket    = "fra"
          + namespace = "frvkqml7frsy"
          + object    = (known after apply)
        }
    }

  # oci_disaster_recovery_dr_protection_group.test_peer will be created
  + resource "oci_disaster_recovery_dr_protection_group" "test_peer" {
      + compartment_id      = "ocid1.compartment.oc1..aaaaaaaahaz26fqhyi3fezbueousr53okuox7iayrmqik4hatmq6o3i3f35q"
      + defined_tags        = (known after apply)
      + display_name        = "displayName"
      + freeform_tags       = (known after apply)
      + id                  = (known after apply)
      + life_cycle_details  = (known after apply)
      + lifecycle_sub_state = (known after apply)
      + peer_id             = (known after apply)
      + peer_region         = (known after apply)
      + role                = (known after apply)
      + state               = (known after apply)
      + system_tags         = (known after apply)
      + time_created        = (known after apply)
      + time_updated        = (known after apply)

      + log_location {
          + bucket    = "fra"
          + namespace = "frvkqml7frsy"
          + object    = (known after apply)
        }
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

oci_disaster_recovery_dr_protection_group.test_peer: Creating...
oci_disaster_recovery_dr_protection_group.test_peer: Still creating... [10s elapsed]
oci_disaster_recovery_dr_protection_group.test_peer: Creation complete after 14s [id=ocid1.drprotectiongroup.oc1.eu-frankfurt-1.aaaaaaaa3p76wpgggtkyebrdtssjzsyzce6n7ofn35cm3oizdzv5l7axnh4q]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Creating...
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Still creating... [10s elapsed]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Still creating... [20s elapsed]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Still creating... [30s elapsed]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Still creating... [40s elapsed]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Still creating... [50s elapsed]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Still creating... [1m0s elapsed]
oci_disaster_recovery_dr_protection_group.test_dr_protection_group: Creation complete after 1m9s [id=ocid1.drprotectiongroup.oc1.eu-frankfurt-1.aaaaaaaanko3oeeloxdti72crr6f2uaz62rtwfc7d4ejljswkz6p43qjxdnq]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Panic Output

None

Expected Behavior

DR Protection Groups should have been associated (one PRIMARY, one STANDBY, as configured).

Actual Behavior

The DR Protection Groups are not associated as per doc.

$ terraform state show oci_disaster_recovery_dr_protection_group.test_dr_protection_group
# oci_disaster_recovery_dr_protection_group.test_dr_protection_group:
resource "oci_disaster_recovery_dr_protection_group" "test_dr_protection_group" {
    compartment_id       = "ocid1.compartment.oc1..aaaaaaaahaz26fqhyi3fezbueousr53okuox7iayrmqik4hatmq6o3i3f35q"
    defined_tags         = {
        "Oracle-Tags.CreatedBy" = "default/[email protected]"
        "Oracle-Tags.CreatedOn" = "2024-05-08T14:30:55.895Z"
    }
    disassociate_trigger = 0
    display_name         = "displayName"
    freeform_tags        = {}
    id                   = "ocid1.drprotectiongroup.oc1.eu-frankfurt-1.aaaaaaaanko3oeeloxdti72crr6f2uaz62rtwfc7d4ejljswkz6p43qjxdnq"
    lifecycle_sub_state  = null
    peer_id              = "ocid1.drprotectiongroup.oc1.eu-frankfurt-1.aaaaaaaa3p76wpgggtkyebrdtssjzsyzce6n7ofn35cm3oizdzv5l7axnh4q"
    peer_region          = "eu-frankfurt-1"
    role                 = "UNCONFIGURED"
    state                = "ACTIVE"
    system_tags          = {}
    time_created         = "2024-05-08 14:30:56.587 +0000 UTC"
    time_updated         = "2024-05-08 14:31:59.262 +0000 UTC"

    association {
        peer_id     = "ocid1.drprotectiongroup.oc1.eu-frankfurt-1.aaaaaaaa3p76wpgggtkyebrdtssjzsyzce6n7ofn35cm3oizdzv5l7axnh4q"
        peer_region = "eu-frankfurt-1"
        role        = "STANDBY"
    }

    log_location {
        bucket    = "fra"
        namespace = "frvkqml7frsy"
        object    = null
    }
}

Steps to Reproduce

  1. terraform apply

Important Factoids

References

bogdan-m-darie avatar May 08 '24 14:05 bogdan-m-darie