[英]Error: “The security token included in the request is invalid” when using Boto python
[英]Serverless Error: The security token included in the request is invalid
當我鍵入 serverless deploy 時出現此錯誤:ServerlessError:請求中包含的安全令牌無效。
我必須在我的serverless deploy
命令中指定 sls deploy --aws-profile
,如下所示:
sls deploy --aws-profile common
你能提供更多信息嗎?
確保您在~/.aws/config
和~/.aws/credentials
獲得了正確的~/.aws/credentials
。 您可以通過運行aws configure
來設置這些。 更多信息: https : //docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-quick-configuration
還要確保有問題的 IAM 用戶具有附加的安全策略,允許訪問您需要的一切,例如 CloudFormation。
就我而言,它缺少無服務器文件中的localstack
條目。 我有所有應該在里面的東西,但它都在custom
里面(而不是custom.localstack
)。
就我而言,我向提供程序添加了區域。 我想它不是從憑證文件中讀取的。
provider:
name: aws
runtime: nodejs12.x
region: cn-northwest-1
要從 AWS 運行 function,您需要使用 access_key_id 和 secret_access_key 配置 AWS,但如果您想在本地運行 function,則可能會出現此錯誤,以便使用此命令
sls invoke local -f functionName
它將在本地而不是在 aws 上運行 function
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.