terraform-provider-oci
terraform-provider-oci copied to clipboard
Documentation for oci_os_management_hub_software_sources is incorrect (or at least incomplete)
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
-
Per documentation,
oci_os_management_hub_software_sources
hassoftware_source_collection
which apparently is iterable. -
Actually,
software_source_collection
itself is a list of 1 which containsitems
which is list of software sourcesThis 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 ]
-
Compare to this which has similar documentation and behaves as expected.
-
This will work for
oci_osmanagement_software_sources
[ for s in data.oci_osmanagement_software_sources.iad.software_sources : s.display_name ]