-
Notifications
You must be signed in to change notification settings - Fork 713
Description
Summary
Creation of oci_os_management_hub_profile is successful and reading state is also works fine, as it seems, from terraform side.
However the OCI console does not list them under the oci_os_management_hub_profile's 'Associated resources' section which is used to list the software sources. This works ok when using the console itself to create the profile.
Please check whether the provider is behaving according to OCI documentation. If provider is ok i will raise a ticket for this to Oracle support.
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.12.2
on linux_amd64
- provider registry.terraform.io/oracle/oci v7.11.0
Affected Resource(s)
oci_os_management_hub_profile
Terraform Configuration Files
Please note that this is the module code. This is used as it is from other tf file using defaults.
terraform {
required_providers {
oci = {
source = "oracle/oci"
version = "7.11.0"
}
}
}
data "oci_os_management_hub_software_sources" "x86_64_software_sources" {
compartment_id = var.tenancy_id
arch_type = ["X86_64"]
os_family = var.ol_version == "8" ? ["ORACLE_LINUX_8"] : ["ORACLE_LINUX_9"]
software_source_type = ["VENDOR"]
state = ["ACTIVE"]
vendor_name = "ORACLE"
}
locals {
# pick ol8 or ol9 software sources
osmh_sources = var.ol_version == "8" ? var.osmh_ol8_sources : var.osmh_ol9_sources
# list software sources for tenant, filter by listed sources and pick tenant specific software source ids
matching_software_sources = [
for source in data.oci_os_management_hub_software_sources.x86_64_software_sources.software_source_collection[0].items :
source.id if contains(local.osmh_sources, source.display_name)
]
}
resource "oci_os_management_hub_profile" "default" {
#Required
compartment_id = var.compartment_id
display_name = "ol${var.ol_version}_default"
profile_type = "SOFTWARESOURCE"
#Optional
registration_type = "OCI_LINUX"
arch_type = "X86_64"
description = "default set of yum software sources"
is_default_profile = false
os_family = var.ol_version == "8" ? "ORACLE_LINUX_8" : "ORACLE_LINUX_9"
software_source_ids = local.matching_software_sources
vendor_name = "ORACLE"
}
variable "compartment_id" {
type = string
}
variable "ol_version" {
type = string
default = "8"
}
variable "osmh_ol8_sources" {
description = "list of osmh sources"
type = list(string)
default = ["ol8_appstream-x86_64", "ol8_baseos_latest-x86_64", "ol8_addons-x86_64", "ol8_uekr7-x86_64", "ol8_oci_included-x86_64", "ol8_ksplice-x86_64", "ol8_oracle_instantclient21-x86_64"]
}
variable "osmh_ol9_sources" {
description = "list of osmh sources"
type = list(string)
default = ["ol9_appstream-x86_64", "ol9_baseos_latest-x86_64", "ol9_addons-x86_64", "ol9_uekr8-x86_64", "ol9_oci_included-x86_64", "ol9_ksplice-x86_64"]
}
Debug Output
https://gist.github.com/lmpeiris/0bb8b42b301fbb63812a8a330b214d56
Expected Behavior
When viewing oci_os_management_hub_profile from OCI console it should list the software source id list under associated resources
Actual Behavior
It doesn't. Please see the screenshot

Steps to Reproduce
Please use the mentioned code as a module and try to create profile.