默认情况下,STS提供一个全球的单一访问入口: https://sts.amazon.com ,这个入口在us-east-1
从这个入口获取的token,默认仅在当前帐号开启的region里生效:
例如我们没有开启一个region,在执行AWS CLI时可能会报以下错误:
aws rds describe-db-clusters --region af-south-1
An error occurred (InvalidClientTokenId) when calling the DescribeDBClusters operation: The security token included in the request is invalid.
当然也可以设置,从global endpoint
里获取的token在所有aws region生效:
AWS建议使用Regional STS endpoints
来进行访问,它可以减少延迟。它的入口如: https://sts.ap-northeast-1.amazonaws.com
从Regional STS endpoints
获取的token,在所有AWS Region都生效
参考:
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html