#!/bin/bash set -e echo "🔨 Building crud-pricing for ARM64 (Graviton)..." # Check if cargo-lambda is installed if ! command -v cargo-lambda &> /dev/null; then echo "❌ 'cargo-lambda' is not installed. Installing..." cargo install cargo-lambda fi # Check if cargo-audit is installed if ! command -v cargo-audit &> /dev/null; then echo "❌ 'cargo-audit' is not installed. Installing..." cargo install cargo-audit fi # Run security audit before building echo "🔒 Running security audit..." cargo audit # Build for Lambda (ARM64) echo "📦 Compiling with cargo lambda..." cargo lambda build --release --arm64 --output-format zip echo "✅ Build complete: target/lambda/bootstrap/bootstrap.zip" echo "" echo "📊 Package size:" ls -lh target/lambda/bootstrap/bootstrap.zip echo "" echo "Next steps:" echo " cd terraform" echo " terraform init" echo " terraform apply"