terraform-provider-oci
terraform-provider-oci copied to clipboard
Output IP Address of DB Node
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
Description
For the node(s) that are created during the creation of oci_database_db_system, provide a way to output the IP address of the node. Currently I do not see that in the datasource: oci_database_db_node, only the host_ip_id which seems to be null.
@revchris,
I'm using the following to get the IP address It works for DBCS VM (single node)
But a more direct way would certainly be useful
data "oci_database_db_nodes" "this" {
compartment_id = oci_database_db_system.this.compartment_id
db_system_id = oci_database_db_system.this.id
}
# get the vnic of the first node in the database system
data "oci_core_private_ips" "this" {
vnic_id = data.oci_database_db_nodes.this.db_nodes[0]["vnic_id"]
}
output "dbcs_node_private_ip" {
description = "The IP address of the DBCS node"
value = data.oci_core_private_ips.this.private_ips[0]["ip_address"]
}
We are very sorry that we couldn't respond to each and every issue reported on GitHub. Although we have refined the process to prioritize customer issues on GitHub, since this issue was reported a while ago, there is a good chance it may have been fixed in the latest version of Terraform Provider OCI.
If you are still experiencing this issue, please create a new issue and label it as Bug.