Gotcha !!! If the error message states that "This Lambda function does not have the right to execute: CreateNetworkInterface", then it would be more reasonable that the role of the lambda should be changed using the appropriate policy. The problem with adding policies to the role that Lambda used was fixed:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Resource": "*", "Action": [ "ec2:DescribeInstances", "ec2:CreateNetworkInterface", "ec2:AttachNetworkInterface", "ec2:DescribeNetworkInterfaces", "autoscaling:CompleteLifecycleAction" ] } ] }
source share