gpt4 book ai didi

amazon-web-services - 尝试在本地访问 DynamoDB 时超时

转载 作者:数据小太阳 更新时间:2023-10-29 03:18:03 27 4
gpt4 key购买 nike

<分区>

我可以使用我的代码访问 AWS 上的 DynamoDB。我可以使用 CLI 访问本地 DynamoDB。但我无法让两者相互交谈。

# deploying dynamodb
docker run \
--detach \
--tty \
--interactive \
--publish 8000:8000 \
--name lokal_dynamodb amazon/dynamodb-local

# deploying Go with SAM
sam local start-api \
--template sam/template.yaml \
--region eu-central-1 \
--profile default

创建 session

sess, err := session.NewSessionWithOptions(session.Options{
// Provide SDK Config options, such as Region.
Config: aws.Config{
Endpoint: aws.String("http://localhost:8000/"),
Region: aws.String("eu-central-1"),
},
})
if err != nil {
logger.Println(err)
return nil
}

错误返回

unction 'ShopFunction' timed out after 20 seconds
Function returned an invalid response (must include one of: body, headers, multiValueHeaders or statusCode in the response object). Response received:
2019-09-21 21:22:03 127.0.0.1 - - [21/Sep/2019 21:22:03] "GET /shop/f10b7ab5-9508-4cfd-acb2-efb2299dd460 HTTP/1.1" 502 -

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com