AWS Registration and Cleanup
EC2 User Data Script
#!/bin/bash
export SDM_ADMIN_TOKEN=XXX
export TARGET_USER=ubuntu
apt update
apt install -y unzip
curl -o sdm.zip -L https://app.strongdm.com/releases/cli/linux
unzip sdm.zip
./sdm admin ssh add \
-p `curl http://169.254.169.254/latest/meta-data/instance-id` \
$TARGET_USER@`curl http://169.254.169.254/latest/meta-data/public-hostname` \
| tee -a "/home/$TARGET_USER/.ssh/authorized_keys"
./sdm admin roles grant `curl http://169.254.169.254/latest/meta-data/instance-id` Engineers
rm sdm.zipCleanup Script
Last updated
Was this helpful?

