/**
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

output "hcx" {
  description = "Details about a HCX Cloud Manager appliance."
  value       = google_vmwareengine_private_cloud.private-cloud.hcx
}

output "id" {
  description = "ID of the private cloud."
  value       = google_vmwareengine_private_cloud.private-cloud.id
}

output "management_cluster" {
  description = "Details of the management cluster of the private cloud."
  value       = google_vmwareengine_private_cloud.private-cloud.management_cluster
}

output "network_config" {
  description = "Details about the network configuration of the private cloud."
  value       = google_vmwareengine_private_cloud.private-cloud.network_config
}

output "nsx" {
  description = "Details about a NSX Manager appliance."
  value       = google_vmwareengine_private_cloud.private-cloud.nsx
}

output "private-cloud" {
  description = "The private cloud resource."
  value       = google_vmwareengine_private_cloud.private-cloud
}

output "private_connections_setup" {
  description = "Cloud SDK commands for the private connections manual setup."
  value = {
    for k, v in var.private_connections : k => <<EOT
    gcloud vmware private-connections create ${v.name} \
  --location=${local.region} \
  --project=${var.project_id} \
  --vmware-engine-network=${local.region}-default \ 
  --description="${v.description}" \
  --routing-mode=${v.routing_mode} \
  --service-project=${local.tenant_host_project[k]} \ 
  --type=${v.type}
  EOT
  }
}

output "state" {
  description = "Details about the state of the private cloud."
  value       = google_vmwareengine_private_cloud.private-cloud.state
}

output "vcenter" {
  description = "Details about a vCenter Server management appliance."
  value       = google_vmwareengine_private_cloud.private-cloud.vcenter
}
