diff --git a/Multicloud/Azure/exa_vmcluster_list.tf b/Multicloud/Azure/exa_vmcluster_list.tf index 9709a42c..7dcf8791 100644 --- a/Multicloud/Azure/exa_vmcluster_list.tf +++ b/Multicloud/Azure/exa_vmcluster_list.tf @@ -1,34 +1,38 @@ + # Get subscription details data "azapi_resource" "subscription" { type = "Microsoft.Resources/subscriptions@2020-06-01" response_export_values = ["*"] } -// OperationId: CloudExadataInfrastructures_ListBySubscription -// GET /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures -data "azapi_resource_list" "listCloudExadataInfrastructuresBySubscription" { - type = "Oracle.Database/cloudVmClusters@2023-09-01-preview" - parent_id = data.azapi_resource.subscription.id +# List all Oracle Exadata infrastructures under a subscription +data "azapi_resource_list" "list_cloud_exadata_infrastructures_by_subscription" { + type = "Oracle.Database/cloudExadataInfrastructures@2023-09-01-preview" + parent_id = data.azapi_resource.subscription.id } -// List Oracle Exadata VM Clusters by Resource Group +# Get existing resource group details +data "azurerm_resource_group" "existing" { + name = "existing-resource-group" +} -data "azurerm_resource_group" "example" { - name = "existing" +# List all Oracle Exadata infrastructures in a specific resource group +data "azapi_resource_list" "list_cloud_exadata_infrastructures_by_resource_group" { + type = "Oracle.Database/cloudExadataInfrastructures@2023-09-01-preview" + parent_id = data.azurerm_resource_group.existing.id } -// OperationId: CloudExadataInfrastructures_ListByResourceGroup -// GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures -data "azapi_resource_list" "listCloudExadataInfrastructuresByResourceGroup" { - type = "Oracle.Database/cloudVmClusters@2023-09-01-preview" - parent_id = azurerm_resource_group.example.id +# Get Database Node information from a specific VM cluster +data "azapi_resource" "db_node" { + type = "Oracle.Database/cloudVmClusters/dbNodes@2023-09-01-preview" + parent_id = var.vm_cluster_id # Pass the VM Cluster ID dynamically + name = var.db_node_name # Pass the database node name dynamically } -// List Database Nodes on an Oracle Exadata VM Cluster +# Variables for VM Cluster ID and Database Node Name +variable "vm_cluster_id" { + description = "The resource ID of the Oracle Exadata VM Cluster" +} -// OperationId: DbNodes_Get -// GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} -data "azapi_resource" "dbNode" { - type = "Oracle.Database/cloudVmClusters/dbNodes@2023-09-01-preview" - parent_id = azapi_resource.cloudVmCluster.id. // VM Cluster Id - name = var.resource_name +variable "db_node_name" { + description = "The name of the specific database node within the VM Cluster" }