- terraform-vm/: ARM VM (A1.Flex Free Tier), Docker Compose, Block Volume, LB+WAF+SSL - terraform-oke/: OKE cluster (3 nodes Intel), NodePort, LB+WAF+SSL - k8s/: namespace, deployments, services, PVC, secrets, configmap - Dockerfile.frontend: self-contained nginx+dist image - push-images.sh: multi-arch build (amd64+arm64) + push to OCIR - dns.tf: conditional OCI DNS Zone + A record (when domain available) - Both stacks 100% independent, no shared modules - .gitignore: terraform state, .terraform/, *.tfvars
76 lines
2.3 KiB
HCL
76 lines
2.3 KiB
HCL
# -----------------------------------------------------------------------------
|
|
# OCI CIS Agent — OKE Deployment Stack
|
|
# Outputs
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# --- Load Balancer ---
|
|
output "load_balancer_ip" {
|
|
description = "Public IP address of the Load Balancer"
|
|
value = oci_load_balancer_load_balancer.main.ip_address_details[0].ip_address
|
|
}
|
|
|
|
output "app_url" {
|
|
description = "Application URL (HTTPS)"
|
|
value = var.domain_name != "" ? "https://${var.domain_name}" : "https://${oci_load_balancer_load_balancer.main.ip_address_details[0].ip_address}"
|
|
}
|
|
|
|
# --- OKE Cluster ---
|
|
output "cluster_id" {
|
|
description = "OCID of the OKE cluster"
|
|
value = oci_containerengine_cluster.main.id
|
|
}
|
|
|
|
output "cluster_name" {
|
|
description = "Name of the OKE cluster"
|
|
value = oci_containerengine_cluster.main.name
|
|
}
|
|
|
|
output "node_pool_id" {
|
|
description = "OCID of the OKE node pool"
|
|
value = oci_containerengine_node_pool.app.id
|
|
}
|
|
|
|
output "kubeconfig_command" {
|
|
description = "Command to generate kubeconfig for the cluster"
|
|
value = "oci ce cluster create-kubeconfig --cluster-id ${oci_containerengine_cluster.main.id} --file $HOME/.kube/config --region ${var.region} --token-version 2.0.0 --kube-endpoint PRIVATE_ENDPOINT"
|
|
}
|
|
|
|
# --- OCIR ---
|
|
output "ocir_backend_url" {
|
|
description = "OCIR URL for the backend image"
|
|
value = "${var.region}.ocir.io/${var.ocir_namespace}/${var.ocir_repo_prefix}/backend"
|
|
}
|
|
|
|
output "ocir_frontend_url" {
|
|
description = "OCIR URL for the frontend image"
|
|
value = "${var.region}.ocir.io/${var.ocir_namespace}/${var.ocir_repo_prefix}/frontend"
|
|
}
|
|
|
|
output "ocir_docker_login_command" {
|
|
description = "Command to login to OCIR"
|
|
value = "docker login ${var.region}.ocir.io"
|
|
}
|
|
|
|
# --- Networking ---
|
|
output "vcn_id" {
|
|
description = "OCID of the VCN"
|
|
value = oci_core_vcn.main.id
|
|
}
|
|
|
|
output "nodes_subnet_id" {
|
|
description = "OCID of the nodes subnet"
|
|
value = oci_core_subnet.nodes.id
|
|
}
|
|
|
|
# --- WAF ---
|
|
output "waf_id" {
|
|
description = "OCID of the WAF"
|
|
value = oci_waf_web_app_firewall.main.id
|
|
}
|
|
|
|
# --- DNS (conditional) ---
|
|
output "dns_nameservers" {
|
|
description = "DNS Zone nameservers (set these at your domain registrar)"
|
|
value = var.domain_name != "" ? [for ns in oci_dns_zone.main[0].nameservers : ns.hostname] : []
|
|
}
|