- 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
57 lines
1.9 KiB
HCL
57 lines
1.9 KiB
HCL
# -----------------------------------------------------------------------------
|
|
# Outputs
|
|
# -----------------------------------------------------------------------------
|
|
|
|
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"
|
|
value = var.domain_name != "" ? "https://${var.domain_name}" : "https://${oci_load_balancer_load_balancer.main.ip_address_details[0].ip_address}"
|
|
}
|
|
|
|
output "instance_private_ip" {
|
|
description = "Private IP of the compute instance"
|
|
value = oci_core_instance.app.private_ip
|
|
}
|
|
|
|
output "instance_ocid" {
|
|
description = "OCID of the compute instance"
|
|
value = oci_core_instance.app.id
|
|
}
|
|
|
|
output "ocir_backend_url" {
|
|
description = "OCIR URL for the backend image"
|
|
value = "${local.ocir_endpoint}/${var.ocir_namespace}/${var.ocir_repo_prefix}/backend"
|
|
}
|
|
|
|
output "ocir_frontend_url" {
|
|
description = "OCIR URL for the frontend image"
|
|
value = "${local.ocir_endpoint}/${var.ocir_namespace}/${var.ocir_repo_prefix}/frontend"
|
|
}
|
|
|
|
output "ssh_command" {
|
|
description = "SSH command to connect to the instance (requires bastion or VPN)"
|
|
value = "ssh opc@${oci_core_instance.app.private_ip}"
|
|
}
|
|
|
|
output "docker_login_command" {
|
|
description = "Docker login command for OCIR"
|
|
value = "docker login ${local.ocir_endpoint} -u '${var.ocir_namespace}/${var.ocir_username}'"
|
|
sensitive = false
|
|
}
|
|
|
|
output "dns_nameservers" {
|
|
description = "DNS nameservers for the zone (only when domain_name is set)"
|
|
value = var.domain_name != "" ? oci_dns_zone.main[0].nameservers[*].hostname : []
|
|
}
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Locals
|
|
# -----------------------------------------------------------------------------
|
|
locals {
|
|
ocir_endpoint = "${var.region}.ocir.io"
|
|
}
|