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

Documentation for oci_os_management_hub_software_sources is incorrect (or at least incomplete)

Open jeliker opened this issue 1 month ago • 4 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 v1.5.7
on darwin_amd64
+ provider registry.terraform.io/oracle/oci v5.42.0

Affected Resource(s)

affected_resources = oci_os_management_hub_software_sources

Terraform Configuration Files

data "oci_os_management_hub_software_sources" "iad" {
  #Required
  compartment_id = local.tenancy_ocid
}

#Comparing to OSMS vs. OSMH above
data "oci_osmanagement_software_sources" "iad" {
  #Required
  compartment_id = local.tenancy_ocid
}

Debug Output

Panic Output

Expected Behavior

  1. Per documentation, oci_os_management_hub_software_sources has software_source_collection which apparently is iterable. image

  2. Actually, software_source_collection itself is a list of 1 which contains items which is list of software sources

    This will cause error though documentation suggests otherwise

    [ for s in data.oci_os_management_hub_software_sources.iad.software_source_collection : s.display_name ]
    

    This will work which is apparent after examining underlying API documentation (vs. Terraform provider docs alone)

    [ for s in data.oci_os_management_hub_software_sources.iad.software_source_collection[0].items : s.display_name ]
    
  3. Compare to this which has similar documentation and behaves as expected. image

  4. This will work for oci_osmanagement_software_sources

    [ for s in data.oci_osmanagement_software_sources.iad.software_sources : s.display_name ]
    

jeliker avatar May 20 '24 17:05 jeliker