title: How can I detect if my application is running in AWS
body: <p>I'm writing an aspnet core app which can be deployed to either azure or aws. The Microsoft libraries for accessing azure logging / configuration sources are well-behaved and fail silently if they're not in an appropriate environment. However the AWS SDK blows up with and exception <code>Unable to get IAM security credentials from EC2 Instance Metadata Service.</code> if the providers are configured outside of AWS. Are there some environment variables I can look at to determine if my application is running in AWS so I can skip those?</p>