Initial commit: Terraform infrastructure, pipelines, docs and scripts

This commit is contained in:
Evert Daniel Romero Garrido
2026-04-14 14:53:05 -06:00
commit 85297b12a2
31 changed files with 4015 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# ===============================================================================================================
# deploy-frontend-s3.sh - Sincroniza el frontend React con S3
# Descripción:
# Sube la carpeta build/ al bucket S3 designado para el sitio estático.
# La invalidación de CloudFront se realiza en el pipeline (paso 7).
#
# Uso:
# S3_FRONTEND_BUCKET=ccsoft-proyectosacc-frontend bash deploy-frontend-s3.sh
#
# Autor: Área de Tecnología y Desarrollo - CCsoft
# ===============================================================================================================
set -euo pipefail
# -------------------------------------------------------------------------------
# Validación de variables
# -------------------------------------------------------------------------------
S3_FRONTEND_BUCKET="${S3_FRONTEND_BUCKET:-}"
BUILD_DIR="${BUILD_DIR:-build}"
if [[ -z "$S3_FRONTEND_BUCKET" ]]; then
echo "[ERROR] Variable S3_FRONTEND_BUCKET no definida" >&2
exit 1
fi
if [[ ! -d "$BUILD_DIR" ]]; then
echo "[ERROR] Directorio ${BUILD_DIR} no encontrado" >&2
exit 1
fi
# -------------------------------------------------------------------------------
# Sincronización a S3
# -------------------------------------------------------------------------------
echo "[INFO] Sincronizando ${BUILD_DIR}/ a s3://${S3_FRONTEND_BUCKET}/ ..."
aws s3 sync "${BUILD_DIR}/" "s3://${S3_FRONTEND_BUCKET}/" --delete
echo "[INFO] Sincronización completada exitosamente"