The region in which an EC2 instance is located is exposed via EC2 Instance Metadata.
Part of instance metadata is Instance Identity Documents. Specifically, the instance-identity/document
endpoint is a dynamic data category that contains instance attributes such as the instanceId, privateIp, instanceType. And most relevantly the instance's region.
We can query the instance identity document via the 169.254.169.254 link-local address. (This only works on EC2 instances):
[ec2-user ~]$ curl http://169.254.169.254/latest/dynamic/instance-identity/document
{
"devpayProductCodes" : null,
"marketplaceProductCodes" : null,