In AWS EC2, I am using Centos 7, I observe strange behaviour where a binary for Hashicorp Vault CLI (/usr/local/bin/vault) is available during boot to commands I run in user data. It is also available for users normally. However, if I run
sudo -i it is not available. If I run
sudo su - root, then it is available!
Why would a command be available in user data as root, but not if I try to login as root using