oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
759 stars 675 forks source link

Datasource oci_disaster_recovery_dr_protection_groups appears to be missing id attribute #1846

Open gillfimj opened 1 year ago

gillfimj commented 1 year ago

Community Note

Terraform Version and Provider Version

Terraform v1.4.2
on windows_amd64
+ provider registry.terraform.io/oracle/oci v4.117.0

Affected Resource(s)

affected resources = oci_disaster_recovery_dr_protection_groups

Expected Behavior

According to the documentation, the datasource oci_disaster_recovery_dr_protection_groups should have as one of it's output attributes "id", which is to be the OCID of the DR Protection Group. I expect "id" to be a valid request.

Actual Behavior

What actually happens is the following error:

│ Error: Unsupported attribute
│
│   on locals.tf line 10, in locals:
│   10:   phx_dpg_id        = data.oci_disaster_recovery_dr_protection_groups.dr_protection_groups.dr_protection_group_collection[0].id
│
│ This object does not have an attribute named "id".
╵

Steps to Reproduce

  1. Create datasource and add local variable reference
    #in datasources.tf
    data "oci_disaster_recovery_dr_protection_groups" "dr_protection_groups" {
    provider       = oci.drregion
    compartment_id = local.nonprod_comp_id
    display_name = "phoenix-TestDR-group1"
    }
    #in locals.tf
    locals {
    phx_dpg_id        = data.oci_disaster_recovery_dr_protection_groups.dr_protection_groups.dr_protection_group_collection[0].id
    }
  2. terraform apply

Important Factoids

References

Documentation reference: https://registry.terraform.io/providers/oracle/oci/latest/docs/data-sources/disaster_recovery_dr_protection_groups

tf-oci-pub commented 1 year ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.

gillfimj commented 1 year ago

A word of suggestion, if you expect the text "affected_resources =" to be included in the affected resources, you might want to include that in the documented comments so people know to include this text and you don't have to keep asking for it.