I'm planning to make a script for package installation, mainly targeted for EC2 Instances.
What I'm planning to do is amazon-linux-extras
, and curl 169.254.169.254/latest/meta-data/public-ipv4
and curl 169.254.169.254/latest/meta-data/local-ipv4
if ec2, else yum add-repo
.
However, what I'm concerned is this script being run by non-ec2 instances as I'm planning to share this script with the public, and the main concern is some machines that aren't EC2 instances having access to 169.254.169.254
.
I googled that IP address but couldn't find another use case other than AWS. Is it okay to assume curl 169.254.169.254
returning something means they're EC2 instance?