首页 > 解决方案 > 您如何访问 AWS Lambda 函数上的 IAM 角色?

问题描述

我正在尝试使用 AWS Lambda,并且对它非常陌生。我实现了 HelloWorld 模板,一切都使用 Pycharm 正确地提升到 AWS。它是导致我出现问题的 ARN 访问。该示例会自动创建一个角色。当我尝试使用它时,我的 template.yaml 没有使用创建的角色,并且我创建的任何角色似乎都没有被访问。

如果有人可以提供帮助,那就太好了。

这是我在我的 template.yaml 上看到的

Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application- 
  model/blob/master/docs/internals/generated_resources.rst#api
ArloEventApi:
  Description: "API Gateway endpoint URL for Prod stage for Hello World function"
  Value: !Sub "https://${ServerlessRestApi}.execute- 
  api.${AWS::Region}.amazonaws.com/Prod/ArloEvents/"
ArloEventFunction:
  Description: "Arlo Events Lambda Function ARN"
  Value: !GetAtt ArloEventFunctionRole.Arn
  #!GetAtt HelloWorldFunction.Arn
ArloEventFunctionIamRole:
  Description: "Implicit IAM Role created for ArloEvent function"
  Value: !GettAtt ArloEventFunctionRole.Arn
  #!GetAtt HelloWorldFunctionRole.Arn 

这是我在 AWS 的角色 在此处输入图像描述

标签: aws-lambdaamazon-iam

解决方案


推荐阅读