#!/usr/bin/env bash
# install-aws-cli.sh
# AWS CLI — Command-line control of every AWS service from one unified client.
# Target: Ubuntu / Debian. Safe to re-run.
# Source guide: devops-hub/tools/aws-cli.html

set -euo pipefail

if [[ $EUID -eq 0 ]]; then
  echo "Run this as a regular sudo-capable user, not root." >&2
  exit 1
fi

echo "==> Download the installer"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

echo "==> Unzip it"
sudo apt-get install -y unzip
unzip awscliv2.zip

echo "==> Run the installer"
sudo ./aws/install

echo "==> Verify"
aws --version

echo "==> Done. AWS CLI installation finished."
