我想为serverless.yml中列出的不同功能分配不同的权限
functions:
hello:
handler: handler.hello
crawl-distributor:
handler: CrawlDistributor.handler
product-scanner:
handler: ProductScanner.handler
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
- lambda:*
Resource: "*"
Run Code Online (Sandbox Code Playgroud)
这似乎不起作用.当我在提供程序级别添加iamRoleStatements时,它可以工作,但最终会将权限应用于所有函数.
provider:
name: aws
runtime: nodejs4.3
stage: api
region: us-east-1
profile: dev
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
- lambda:*
Resource: "*"
Run Code Online (Sandbox Code Playgroud)