AWS Cloud Architecture•Part 3: Compute, Containers & Serverless (21 - 35)
Lambda in VPC without cold start penalty (Hyperplane ENIs).
In Simple Words: AWS uses Hyperplane (shared network virtualization technology). Rather than creating a new Elastic Network Interface (ENI) for every single Lambda instance, Lambdas attach to pre-provisioned shared Hyperplane ENIs, eliminating the multi-second VPC cold start penalty.
hcl
# Attaching Lambda to VPC Subnets and Security Groups:
resource "aws_lambda_function" "vpc_lambda" {
function_name = "VpcService"
vpc_config {
subnet_ids = aws_subnet.private[*].id
security_group_ids = [aws_security_group.lambda_sg.id]
}
}