Ensure VPC Lambda functions operate in more than one Availability Zone for improved reliability.
Rule | VPC Lambda functions should operate in more than one Availability Zone |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Medium |
Rule Description:
The VPC Lambda functions should be configured to operate in more than one Availability Zone (AZ) as recommended by AWS Foundational Security Best Practices. Operating in multiple AZs ensures high availability and fault tolerance for your Lambda functions, as it allows them to run in parallel across different physical infrastructure in case of failures or disruptions.
Troubleshooting Steps:
Remediation:
To configure your VPC Lambda functions to operate in more than one Availability Zone, follow these step-by-step instructions:
CLI Command:
To configure the VPC settings of your Lambda function to operate in more than one Availability Zone using AWS CLI, follow these steps:
aws lambda update-function-configuration --function-name <function-name> --vpc-config SubnetIds=<subnet-id-1>,<subnet-id-2>,... AvailabilityZone=us-west-2a,us-west-2b,...
Replace
<function-name>
with the name of your Lambda function.
Replace <subnet-id-1>,<subnet-id-2>
with the IDs of the additional subnets from different Availability Zones.
Replace us-west-2a,us-west-2b
with the Availability Zones where the subnets are located.Note:
Make sure to follow AWS Best Practices for high availability and fault tolerance, and regularly review and update your Lambda functions' configurations to maintain optimal performance and reliability.