【发布时间】:2020-03-02 18:06:54
【问题描述】:
无法让角色访问两个表。 template.yaml 的示例 YAML:
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: path/to/something
Handler: index.handler
Runtime: nodejs10.x
Events:
Get:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /path/to/other/thing
Method: post
Policies:
DynamoDBCrudPolicy:
TableName:
table1
table2
我需要这个函数才能在 table1 和 table2 上读/写,但这不起作用。我试过了:
- table1
- table2
但这也不起作用。也试过了:
Policies:
- DynamoDBCrudPolicy:
TableName:
table1
- DynamoDBCrudPolicy:
TableName:
table2
但这也会出错。我该如何正确地做到这一点?
【问题讨论】:
标签: amazon-web-services aws-lambda yaml amazon-cloudformation aws-sam