I have a custom resource and I want the output to be the private ipv4 address of a specific lambda's elastic network interface of my choosing. I've figured out how to get this working and fetching an EC2's private ipv4 address.
Unfortunately the resources I do not have total control over so I cannot just add tags, and they get spun up and spun down a lot.
I know through the console, I can select the function and then examine a security group attached to it, and then search that security group in the EC2 Console screen under Network Interface, to find the Network interface that would attach to the lambda. But as far as I know, there's no direct filters or boto3 API calls to do this. I tried filtering on owner being Amazon but the owner of all the lambdas come under the AWS account in which they're housed in. I need that ENI IP address for a config file that deals with security/etc otherwise the lambda won't be able to communicate.