front-integrations/terraform/build_packages.sh
Adam Moussa 1ad265b177
feat(terraform): migrate front-integrations to HCP Terraform
Freeze SAM CD and add Terraform for seahaven-prod (Lambdas, DynamoDB,
EventBridge, alarms) so HCP becomes the sole deploy path. Include prod
secret ARNs in the tfvars example for workspace wiring.
2026-08-05 18:38:12 -04:00

29 lines
916 B
Bash
Executable file

#!/usr/bin/env bash
# Package Lambda zips for HCP plan/apply. Runs on the Terraform worker.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
BUILD="${ROOT}/build"
SRC="$(cd "${ROOT}/../src" && pwd)"
rm -rf "${BUILD}"
mkdir -p "${BUILD}/sla_monitor" "${BUILD}/user_sync"
cp "${SRC}/sla_monitor/app.py" "${BUILD}/sla_monitor/app.py"
cp "${SRC}/user_sync/app.py" "${BUILD}/user_sync/app.py"
python3 -m pip install \
--quiet \
--disable-pip-version-check \
-r "${SRC}/user_sync/requirements.txt" \
-t "${BUILD}/user_sync/" \
--platform manylinux2014_aarch64 \
--implementation cp \
--python-version 3.12 \
--only-binary=:all: \
--upgrade
# Runtime provides boto3; drop the copy to keep the zip smaller.
rm -rf "${BUILD}/user_sync/boto3" "${BUILD}/user_sync/botocore" \
"${BUILD}/user_sync/s3transfer" "${BUILD}/user_sync/jmespath" \
"${BUILD}/user_sync/"*.dist-info 2>/dev/null || true