使用PowerShell Get-LMFunctionList时遇安全令牌无效错误,AWS CLI正常
AWS PowerShell模块调用Lambda接口报错问题
环境信息
- PowerShell版本:5.1
- AWS.Tools.Lambda版本:4.1.530
问题现象
导入AWS.Tools.Lambda模块后,执行PowerShell命令:
Get-LMFunctionList -Region "eu-west-1"
收到错误提示:
Get-LMFunctionList : The security token included in the request is invalid
但执行对应的AWS CLI命令:
aws lambda list-functions --region eu-west-1
完全正常,可成功获取Lambda函数详情,说明问题仅针对该PowerShell命令。
已尝试的无效解决方案
- 新建访问密钥并添加到凭证文件
- 使用
aws configure重新生成.aws\credentials文件 - 多次重启PowerShell会话
- 未使用会话密钥进行连接
- 排除配置文件问题(CLI可正常使用)
.aws\cli\cache\目录无缓存文件
内容的提问来源于stack exchange,提问作者gerard
相关产品推荐
相关产品推荐

