如何调用功能的AWS Lambda权限列表 [英] How to call a list of AWS Lambda permissions for a function

查看:175
本文介绍了如何调用功能的AWS Lambda权限列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要允许AWS服务调用lambda函数,您需要应用权限.此权限的json可能看起来像这样:

To allow a AWS service to invoke a lambda function you need to apply permissions. The json for this permission could look a little something like so:

{
    "FunctionName": "someFunction", 
    "StatementId": "1", 
    "Action": "lambda:InvokeFunction", 
    "Principal": "codecommit.amazonaws.com", 
    "SourceArn": "arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo", 
    "SourceAccount": "80398EXAMPLE"
}

以上摘录自 http://docs .aws.amazon.com/codecommit/latest/userguide/how-to-notify-lambda.html

使用命令行界面(cli)轻松添加权限.参见 http://docs.aws.amazon.com/cli/latest/reference/lambda/add-permission.html .可以使用 http://上的命令将其删除docs.aws.amazon.com/cli/latest/reference/lambda/remove-permission.html

A permission is easy enough to add using the command line interface (cli). See http://docs.aws.amazon.com/cli/latest/reference/lambda/add-permission.html. And it can be removed using the command at http://docs.aws.amazon.com/cli/latest/reference/lambda/remove-permission.html

无法找到的是列出现有权限的一种方法.在Lambda和IAM GUI中,我到处都看过.我在 http://docs.aws.amazon.com/cli/latest/reference/lambda/index.html#cli-aws-lambda -似乎没有列出权限的命令.我还看着iam命令嘲笑

What I cannot find is a way to list existing permissions. I've looked everywhere in the Lambda and the IAM GUI. I've looked at the list of cli commands for Lambda at http://docs.aws.amazon.com/cli/latest/reference/lambda/index.html#cli-aws-lambda - there seems to be no command to list permissions. I also looked at the iam commands for a laugh at http://docs.aws.amazon.com/cli/latest/reference/iam/index.html#cli-aws-iam. Nothing sticks out there.

问题是:如何获取Lambda权限列表?我在这里遗漏了什么?如果实际上是不可能的,为什么?希望有一些AWS专家可以对此有所启发

So the question : how do you get a list of Lambda permissions? What am I missing here and if it is actually impossible, why? Hopefully some AWS experts out there who can shed light on this

推荐答案

这个人也使我感到困惑.您可以使用AWSCLI中的aws lambda add-permission命令向Lambda函数添加权限.您可以使用aws lambda remove-permission删除权限.但是要查看现有权限,请使用aws lambda get-policy.

This one confused me, too. You can add a permission to a Lambda function with the aws lambda add-permission command in the AWSCLI. You can remove a permission using aws lambda remove-permission. But to see the existing permissions you use aws lambda get-policy.

这篇关于如何调用功能的AWS Lambda权限列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆