-
Notifications
You must be signed in to change notification settings - Fork 724
Description
Impacted Resources
affected_resources = oci_identity_user_group_membership
Summary
Unable to import existing oci_identity_user_group_membership resources using the import block, even when providing accurate and verified membership OCIDs.
Resource Type: oci_identity_user_group_membership
Terraform Configuration
Resource Definition:
resource "oci_identity_user_group_membership" "example" {
user_id = "ocid1.user.oc1..aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
group_id = "ocid1.group.oc1..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
Import Block:
import {
to = oci_identity_user_group_membership.example
id = "ocid1.groupmembership.oc1..cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
}
Expected Behavior
The import should succeed when providing a valid membership OCID as the import ID. The resource should be imported into the Terraform state with the corresponding user_id and group_id attributes matching the existing OCI membership.
Actual Behavior
The import fails with the following error message
│ Error: Cannot import non-existent remote object
│
│ While attempting to import an existing object to
│ "oci_identity_user_group_membership.identity_user_group_membership,
│ the provider detected that no object exists with the given id. Only
│ pre-existing objects can be imported; check that the id is correct and that
│ it is associated with the provider's configured region or endpoint, or use
│ "terraform apply" to create a new remote object for this resource.
even when:
The membership OCID exists and is verified in the OCI console
The user_id and group_id in the configuration match the actual membership
All OCIDs are accurate and valid
Steps to Reproduce
- Create an existing user group membership in OCI (or identify an existing one)
- Note the membership OCID, user OCID, and group OCID
- Define an oci_identity_user_group_membership resource with the matching user_id and group_id
- Create an import block using the membership OCID as the import ID
- Run terraform plan or terraform apply
- Observe the import failure
Import ID Format Used
According to the provider documentation, the import ID format should be:
terraform import oci_identity_user_group_membership.example <user_group_membership_id>
Where user_group_membership_id is the membership OCID (e.g., ocid1.groupmembership.oc1..cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc)
Request
Please help us to understand why the import functionality for oci_identity_user_group_membership fails despite providing accurate and verified OCIDs. Is there an issue with the import implementation for this resource type?