Is the permission DetachNetworkInterfaces reasonable?

0

If you run an AWS Lambda function in a VPC, does it make sense to add the action DetachNetworkInferace to the IAM role?

We run all of our Lambda function within a VPC. It is my understanding that in this case the function needs an ENI to access VPC resources. To enable this we attach the AWS managed policy AWSLambdaVPCAccessExecutionRole to the functions. While browsing the permission I noticed that the action DetachNetworkInterface is missing.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",
                "logs:CreateLogStream",
                "logs:PutLogEvents",
                "ec2:CreateNetworkInterface",
                "ec2:DescribeNetworkInterfaces",
                "ec2:DeleteNetworkInterface"
            ],
            "Resource": "*"
        }
    ]
}

How can the container that runs the function delete the ENI if it can't detach the ENI?

This is a bit of deep dive question, but I am just curious about the internals of AWS Lambda.

raupach
已提问 5 年前316 查看次数
2 回答
0

Hello,

AWS Lambda is a managed service, the operations of attaching/detaching the network interfaces are taken care of internally. As this is internal information, we cannot provide much details related to this. However, we need the create and delete permissions because these ENIs are created in your account and would require permissions for the same.

I hope this answers your query. Please let us know if you have any other queries.

已回答 5 年前
0

Thanks!

raupach
已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容