0

我的pynamodb文檔以下pynamodb亞馬遜憑證例外

class Thread(Model): 
    class Meta: 
     read_capacity_units = 1 
     write_capacity_units = 1 
     table_name = "Thread" 
     region = 'us-west-1' 
     host = "http://localhost:8888" 

    forum_name = UnicodeAttribute(hash_key=True) 
    subject = UnicodeAttribute(range_key=True) 
    views = NumberAttribute(default=0) 
    replies = NumberAttribute(default=0) 
    answered = NumberAttribute(default=0) 
    tags = UnicodeSetAttribute() 
    last_post_datetime = UTCDateTimeAttribute(null=True) 

# Delete the table 
# print(Thread.delete_table()) 

# Create the table 
if not Thread.exists(): 
    Thread.create_table(wait=True) 

,當我運行上面的代碼中的報錯

DEBUG:pynamodb.connection.base:調用DescribeTable帶參數{ '表名':'主題'}

,並引發異常: -

提高TableError( 「無法描述表:{0}」 的格式(E),E。) TableError:尤娜ble來描述表:無法找到憑據

如何提供pynamodb aws_secret_key_id和aws_access密鑰。我正在本地計算機上使用dynamodb本地運行示例。

我如何提供pynamodb中的憑證信息。 的aws_secret_key_id和aws_access_key但仍然憑證exeception

的我沒有設置環境變量有什麼辦法提供aws_access_key_id和aws_secret_access_key在像波紋管例如pynamodb參數: -

此代碼的工作,並創建數據庫,但我想用pynamodb庫

dynamodb = boto3.resource( 'dynamodb',REGION_NAME = '美西2',aws_access_key_id = 「快捷鍵」, aws_secret_access_key = 「祕密接取鑰匙」, endpoint_url =「http:// localhost:8888」)

回答