# ===============================================================================================================
# outputs.tf - Outputs de infraestructura para proyectosacc
# Descripción:
#       Expone información útil de los recursos creados por Terraform.
#
# Autor: Área de Tecnología y Desarrollo - CCsoft
# ===============================================================================================================

output "ec2_public_ip" {
  description = "IP pública del servidor de la API"
  value       = aws_instance.api.public_ip
}

output "ec2_public_dns" {
  description = "DNS público del servidor de la API"
  value       = aws_instance.api.public_dns
}

output "rds_endpoint" {
  description = "Endpoint de conexión a la base de datos"
  value       = aws_db_instance.main.endpoint
}

output "s3_frontend_bucket" {
  description = "Nombre del bucket S3 del frontend React"
  value       = aws_s3_bucket.frontend.bucket
}

output "s3_artifacts_bucket" {
  description = "Nombre del bucket S3 de artefactos de la API"
  value       = aws_s3_bucket.artifacts.bucket
}

output "cloudfront_domain" {
  description = "Dominio de la distribución CloudFront"
  value       = aws_cloudfront_distribution.main.domain_name
}

output "cloudfront_distribution_id" {
  description = "ID de la distribución CloudFront"
  value       = aws_cloudfront_distribution.main.id
}

output "route53_record" {
  description = "Registro DNS creado en Route 53"
  value       = aws_route53_record.main.name
}

output "acm_certificate_arn" {
  description = "ARN del certificado SSL en ACM"
  value       = aws_acm_certificate.main.arn
}

output "vpc_id" {
  description = "ID de la VPC creada"
  value       = aws_vpc.main.id
}
