AWS auto-disable certain services if public address is not available

Certain services and functions do not work and do not make sense if the instance does not have a public IP or DNS address. In the instance does not have a public address these services and functions should be automatically disabled: