在aws wafv2上执行标记操作时,ARN无效



我正在尝试使用aws wafv2cli命令查看和添加我的web acl上的标签。其他命令似乎工作正常,但在标记中使用ARN时,我得到以下错误。

命令:

aws wafv2 list-tags-for-resource 
--resource-arn arn:aws:wafv2:us-east-1:<account_id>:global/webacl/<acl_name>/<acl_id>

输出:

An error occurred (WAFInvalidParameterException) when calling the TagResource operation: 
Error reason: The ARN isn't valid. A valid ARN begins with arn: and includes other 
information separated by colons or slashes., field: RESOURCE_ARN, parameter: <arn>

知道为什么会这样吗?我知道旧版本的aws waf使用不同的格式。但是我现在使用的是wafv2,所以我认为我已经使用了正确的URL格式。

刚刚确认修复。正如上面的注释所指出的,我只需要添加--region参数,并且它需要匹配ARN中显示的区域

虽然我不确定为什么会发生这种情况,因为我的~/.aws/config区域已经默认为us-east-1了。