diff --git a/earthaccess/store.py b/earthaccess/store.py index f2f3618e..173e1f47 100644 --- a/earthaccess/store.py +++ b/earthaccess/store.py @@ -141,11 +141,13 @@ def _am_i_in_aws(self) -> bool: try: # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html resp = session.get( - "http://169.254.169.254/latest/meta-data/public-ipv4", timeout=1 + "http://169.254.169.254/latest/meta-data/placement/region", timeout=1 ) except Exception: return False - if resp.status_code == 200: + + if resp.status_code == 200 and b"us-west-2" == resp.content: + # On AWS in region us-west-2 return True return False