5
Tôi muốn gán quyền khác nhau cho các chức năng khác nhau được liệt kê trong serverless.yml tôiLàm cách nào để gán IamRoleStatements cấp hàm trong Serverless Framework?
functions:
hello:
handler: handler.hello
crawl-distributor:
handler: CrawlDistributor.handler
product-scanner:
handler: ProductScanner.handler
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
- lambda:*
Resource: "*"
này dường như không làm việc. Khi tôi thêm iamRoleStatements ở cấp nhà cung cấp, nó hoạt động, nhưng kết thúc việc áp dụng các quyền cho tất cả các hàm.
provider:
name: aws
runtime: nodejs4.3
stage: api
region: us-east-1
profile: dev
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
- lambda:*
Resource: "*"