terraform.aws-baseline-infra/modules/ManagementGovernance/Monitoring.EC2/get-os-platform.sh

12 lines
254 B
Bash
Executable File

#!/bin/bash
eval "$(jq -r '@sh "id=\(.input)"')"
EC2OS=$(aws ec2 describe-instances --instance-ids $id | jq -r '.Reservations[].Instances[].PlatformDetails')
if [ $EC2OS == "Windows" ]; then
echo '{"os": "Windows"}'
else
echo '{"os": "Linux"}'
fi