const table = new dynamodb.Table(this, 'MyTable', {
partitionKey: {
name: 'customer_id',
type: dynamodb.AttributeType.STRING
},
sortKey:{
name:"orderId",
type:dynamodb.AttributeType.STRING
}});我已经使用cdk在aws-dynamodb上创建了一个表,但我想使用admin用户创建一个表。
发布于 2021-11-10 15:36:25
与postgres不同,DynamoDB没有数据库用户的概念。相反,访问是由IAM user or role credentials控制的。
例如,如果您有一个发出发电机请求的lambda函数,那么您需要为lambda的角色赋予适当的权限。CDK让这件事变得超级简单:
// give the lambda read-write permissions
table.grantReadWriteData(myLambdaFunction);https://stackoverflow.com/questions/69902635
复制相似问题