[英]AWS Toolkit Visual Studio Code Mac Unable to locate credentials
我在我的 visual studio 代碼中成功安裝了 aws 工具包。 我用區域設置了所有憑據,文件是 at.aws。 在 Visual Studio 中,aws 資源管理器顯示了我的個人資料。
但是當我嘗試運行以下代碼時:
import boto3
import pprint as pp
dynamodb_client = boto3.client('dynamodb')
table_name = 'Test_Dynamo'
pk = 'U-0001'
stmt = f"SELECT * FROM {table_name} WHERE pk=? and begins_with(sk,'#U')"
pmt =[{ "S": pk }]
resp = dynamodb_client.execute_statement( Statement=stmt , Parameters= pmt )
pp.pprint(resp['Items'])
我收到以下錯誤
Unable to locate credentials
我期待從 DynamoDB 中獲取一個項目。
我在 Visual Studio Code 的 jupyter notebook 擴展中運行代碼,如果這與它有關,我的 aws 帳戶是免費套餐。
您是說您設置了區域的所有憑據。 據我所知,憑據存儲在憑據文件中,區域存儲在配置文件中。 也許這與此有關,您可能將兩者放在同一個文件中會導致問題,您可以檢查一下嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.