首页 > 解决方案 > 使用 AWS Amplify 从 iOS (Swift) 连接到 Dynamodb

问题描述

我曾经使用 AWS 移动 SDK 直接连接到从 iOS 访问 Dynamodb 表。现在 AWS 鼓励迁移到 Amplify。在文档中没有关于 Dynamodb 读/写操作的指南。我们应该使用 API 访问 Dynamodb 还是可以使用 AWSDynamoDBObjectMapper(请参阅https://docs.aws.amazon.com/aws-mobile/latest/developerguide/mobile-hub-add-aws-mobile-nosql-database.html )

在此处输入图像描述

标签: iosswiftamazon-dynamodbaws-amplify

解决方案


除非我弄错了,因为我是新手,我相信我们必须使用REST API才能在 Amplify 上下文中调用各种 AWS 服务。因此,Lambda 函数将执行您的 DynamoDB 访问。

更新 当您添加 REST API 时,系统会询问您要使用哪种功能模板。第一个选项是:

Amazon DynamoDB 表的 CRUD 功能(与 Amazon API Gateway 和 Amazon DynamoDB 集成)


推荐阅读