Open Jiefei-Wang opened 3 years ago
This is also an issue for the get_caller_identity()
function.
I happened to have AWS_DEFAULT_REGION
set as an environment variable and was getting the same error message. hardcoding to get_caller_identity(region="us-east-1")
fixed the issue. Unsetting the environment variable first and then calling with no parameters also worked.
#works
aws.iam::get_caller_identity(region="us-east-1")
#alternative option, also works
Sys.unsetenv("AWS_DEFAULT_REGION")
aws.iam::get_caller_identity()
Please specify whether your issue is about:
Hi, thanks for the great package.
When I tried the
list_roles
function, my default region was "ap-southeast-1" and I immediately got this errorIt turns out that the IAM does not require a region for it is a global setting. We can confirm it by going to the IAM setting on the web console, the region at the top right corner should show "global". The default region
us-east-1
should be used in the HTTP request. A temporary workaround for me is to pass the region as an argumentI'm not sure how many functions will have the same issue but I guess
list_roles
is not the only one. It would be better to not follow the region setting returned byaws.signature::locate_credentials
and just set it to"us-east-1"
. Then the user's default region will not mess up the IAM HTTP request.Best, Jiefei