我的AWS配置文件默认配置为eu-west-1,但是当我运行AWS CLI命令时,它在us-east-1中执行:
>aws configure get region
eu-west-1
>aws events put-rule --name hourly_trigger --schedule-expression "rate(60 minutes)"
{
"RuleArn": "arn:aws:events:us-east-1:588237033746:rule/hourly_trigger"
}
我调查了配置文件和配置选项,但无法确定原因。我的个人资料设置如下:
[default]
region = eu-west-1
如果我添加--region,此命令将在预期的区域工作
>aws events put-rule --name hourly_trigger --schedule-expression "rate(60 mi
nutes)" --region eu-west-1
{
"RuleArn": "arn:aws:events:eu-west-1:588237033746:rule/hourly_trigger"
}
答案 0 :(得分:2)
AWS区域是通过三种方式获得的:
确保未设置AWS_DEFAULT_REGION。然后它将自动使用配置文件中定义的区域。