beeta/terraform/outputs.tf
2026-01-05 22:54:27 -05:00

68 lines
1.9 KiB
HCL

# =============================================================================
# App Server Outputs
# =============================================================================
output "app_droplet_id" {
description = "ID of the app server droplet"
value = module.app_server.droplet_id
}
output "app_public_ip" {
description = "Public IPv4 address of the app server"
value = module.app_server.public_ip
}
output "app_private_ip" {
description = "Private IPv4 address of the app server (VPC)"
value = module.app_server.private_ip
}
output "app_ssh_port" {
description = "SSH port for the app server"
value = var.app_ssh_port
}
output "app_firewall_id" {
description = "ID of the app server firewall"
value = module.app_server.firewall_id
}
# =============================================================================
# Connection Info
# =============================================================================
output "ssh_config" {
description = "SSH config snippet for connecting to the app server"
value = <<-EOT
# Add to ~/.ssh/config
# Connect via jump host
Host realms-app
HostName ${module.app_server.private_ip}
Port ${var.app_ssh_port}
User root
ProxyJump realms-jump
IdentityFile ~/.ssh/id_ed25519
# Or direct connection (if on VPC)
Host realms-app-direct
HostName ${module.app_server.public_ip}
Port ${var.app_ssh_port}
User root
IdentityFile ~/.ssh/id_ed25519
EOT
}
output "deploy_info" {
description = "Deployment information for CI/CD"
value = <<-EOT
App Server Public IP: ${module.app_server.public_ip}
App Server Private IP: ${module.app_server.private_ip}
SSH Port: ${var.app_ssh_port}
Domain: ${var.app_domain}
Add these to Forgejo secrets:
DEPLOY_HOST: ${module.app_server.private_ip}
DEPLOY_PORT: ${var.app_ssh_port}
EOT
}