You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just lost a couple of hours debugging an issue with a new environment where our Elixir code crashed with a permission error but the equivalent AWS CLI command on a shell ran just fine. This was an EC2 box in us-east-2 using an instance role.
It took me a while to realize that ExAWS has a default region when nothing is set, us-east-1. That explained why a different account (in us-east-1) ran the code just fine.
Consider removing that default, please. I think it's not the first time that a colleague or I got tricked by it, although today was one of the times that it took quite a while to realize that this was at hand. "us-east-1" is not a special region (anymore), and it is much more helpful to just crash when developers forget to explicitly configure a region either VM-wide or for a request. If we must have a default region, then probably the equivalent of {:system, "AWS_REGION"} is better than a hardcoded region.
(I am filing this as an issue to see whether people agree; I am, of course, more than happy to follow up with a PR if maintainers respond positively).
The text was updated successfully, but these errors were encountered:
cdegroot
changed the title
Default region is more harmful than helpfuil
Default region is more harmful than helpful
Nov 8, 2023
I just lost a couple of hours debugging an issue with a new environment where our Elixir code crashed with a permission error but the equivalent AWS CLI command on a shell ran just fine. This was an EC2 box in us-east-2 using an instance role.
It took me a while to realize that ExAWS has a default region when nothing is set, us-east-1. That explained why a different account (in us-east-1) ran the code just fine.
Consider removing that default, please. I think it's not the first time that a colleague or I got tricked by it, although today was one of the times that it took quite a while to realize that this was at hand. "us-east-1" is not a special region (anymore), and it is much more helpful to just crash when developers forget to explicitly configure a region either VM-wide or for a request. If we must have a default region, then probably the equivalent of
{:system, "AWS_REGION"}
is better than a hardcoded region.(I am filing this as an issue to see whether people agree; I am, of course, more than happy to follow up with a PR if maintainers respond positively).
The text was updated successfully, but these errors were encountered: