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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南