Last active
August 18, 2025 17:29
-
-
Save fidanf/c76b4a7c60d10eb8c1909edb191b5379 to your computer and use it in GitHub Desktop.
ssm-agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| ARCH=$(dpkg --print-architecture) # returns amd64 or arm64 | |
| TMPDIR=$(mktemp -d) | |
| PKG_FILE="$TMPDIR/amazon-ssm-agent.deb" | |
| # Map dpkg arch to SSM path | |
| case "$ARCH" in | |
| amd64) | |
| SSM_URL="https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb" | |
| ;; | |
| arm64) | |
| SSM_URL="https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_arm64/amazon-ssm-agent.deb" | |
| ;; | |
| *) | |
| echo "❌ Unsupported architecture: $ARCH" | |
| exit 1 | |
| ;; | |
| esac | |
| echo "➡️ Downloading Amazon SSM Agent for $ARCH..." | |
| wget -qO "$PKG_FILE" "$SSM_URL" | |
| echo "➡️ Installing package..." | |
| sudo dpkg -i "$PKG_FILE" | |
| echo "➡️ Enabling and starting service..." | |
| sudo systemctl enable --now amazon-ssm-agent | |
| # Cleanup | |
| trap 'rm -rf "$TMPDIR"' EXIT | |
| echo "✅ Amazon SSM Agent installed successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment