我正在尝试从 Rekognition 框架调用 detectText 方法,但它未能调用 S3 存储桶。我不确定如何在 SAM 模板中赋予角色。下面是我的 SAM 模板
GetTextFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: gettextfn/
Handler: text.handler
Runtime: nodejs12.x
Timeout: 3
MemorySize: 128
Environment:
Variables:
imagebucket: !Ref s3bucket
Events:
TextApiEvent:
Type: HttpApi
Properties:
Path: /gettext
Method: get
ApiId: !Ref myapi