我有一个codestar项目,该项目调用python lambda函数。此函数尝试将项目放入DynamoDB中。我收到以下错误:
"errorMessage": "An error occurred (AccessDeniedException) when calling the PutItem operation: User: arn:aws:sts::13556632xxxx:assumed-role/CodeStar-split-lambda-Execution/awscodestar-split-lambda-lambda-CreateUser-RBA73BJH7NHY is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-east-1:1355663xxxx:table/split-users"
}
我在AmazonDynamoDBFullAccess
角色中加入了AWSLambdaBasicExecutionRole
,AWSLambdaInvocation-DynamoDB
和CodeStar-split-lambda-Execution
策略,但仍然出现错误。
我也制定了自己的政策并尝试了。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"dynamodb:*"
],
"Resource": [
"arn:aws:dynamodb:us-east-1:13556632xxxx:table/split-users"
]
}
]
}
我如何获得dynamoDB的授权来放置物品?