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
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# ===============================================================================================================
# notify-telegram.sh - Envía notificaciones a Telegram
# Descripción:
# Wrapper simple para enviar mensajes a un chat de Telegram.
# Requiere TELEGRAM_BOT_TOKEN y TELEGRAM_CHAT_ID como variables
# de entorno.
#
# Uso:
# bash notify-telegram.sh "Mensaje de prueba"
#
# Autor: Área de Tecnología y Desarrollo - CCsoft
# ===============================================================================================================
set -euo pipefail
# -------------------------------------------------------------------------------
# Validación
# -------------------------------------------------------------------------------
TELEGRAM_BOT_TOKEN="${TELEGRAM_BOT_TOKEN:-}"
TELEGRAM_CHAT_ID="${TELEGRAM_CHAT_ID:-}"
MESSAGE="${1:-}"
if [[ -z "$TELEGRAM_BOT_TOKEN" ]]; then
echo "[ERROR] TELEGRAM_BOT_TOKEN no definido" >&2
exit 1
fi
if [[ -z "$TELEGRAM_CHAT_ID" ]]; then
echo "[ERROR] TELEGRAM_CHAT_ID no definido" >&2
exit 1
fi
if [[ -z "$MESSAGE" ]]; then
echo "[ERROR] Debe proporcionar un mensaje como primer argumento" >&2
exit 1
fi
# -------------------------------------------------------------------------------
# Envío de mensaje
# -------------------------------------------------------------------------------
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d "chat_id=${TELEGRAM_CHAT_ID}" \
-d "text=${MESSAGE}" \
-d "parse_mode=Markdown" > /dev/null
echo "[INFO] Mensaje enviado a Telegram"