I suggest that the default region should be loaded from the local AWS configuration file rather than a hardcoded value in the script. The AWS SDK handles this automatically if no region is supplied to its constructor. The SDK is already loading credentials from the shared credentials file so it should do the same for the region. I assume most people are using this script with the credentials they configured when installing the AWS CLI; this requires a default region to be set so it makes sense to use this value (which is also the same value loaded by most other tooling).
Perhaps for those edge-cases who are supplying credentials by manually setting environment variables a fallback region can be set in the script, although even in those cases I'd imagine they would be setting the AWS_REGION environment variable as well.
I suggest that the default region should be loaded from the local AWS configuration file rather than a hardcoded value in the script. The AWS SDK handles this automatically if no region is supplied to its constructor. The SDK is already loading credentials from the shared credentials file so it should do the same for the region. I assume most people are using this script with the credentials they configured when installing the AWS CLI; this requires a default region to be set so it makes sense to use this value (which is also the same value loaded by most other tooling).
Perhaps for those edge-cases who are supplying credentials by manually setting environment variables a fallback region can be set in the script, although even in those cases I'd imagine they would be setting the
AWS_REGION
environment variable as well.