Search code examples
aws-lambdaaws-cloudformationaws-cli

update-function-configuration with more than five security groups


I am trying to update my lamda function using the AWS CLI command

aws lambda update-function-configuration --function-name <function_name> --vpc-config SubnetIds=<comma separated subnet ids>,SecurityGroupIds=<comma separated security groups>

I have ten security groups and the cli is not allowing me to use more than five. Am I doing something wrong? How to proceed in this case?


Solution

  • Lambda uses a network interface to provide VPC connectivity. The soft limit is 5 security groups per network interface. The absolute maximum is 16. You will need to contact AWS to request an increase.

    Note: I do not recommend using more than 5 security groups as this will affect your network performance.

    Reference link for security group limits:

    Amazon VPC Limits

    How to request an AWS Service Limit increase:

    AWS Service Limits