<  Back to rules search

Lambda function has access to VPC resources

lambda

Description

Configure your Amazon Lambda Function to have access to VPC-only resources.

Rationale

By default, Amazon Lambda functions run in a secure VPC with access to any AWS service and the internet. Selecting which resources have access secures the connections within your private VPC.

Remediation

From the console

Follow the Configuring VPC access (console) docs to configure VPC access for an existing function.

From the command line

  1. Run update-function-configuration with your Amazon Lambda function name and VPC configuration. Set network connectivity to AWS resources within the configured VPC.

    update-function-configuration.sh

       aws lambda update-function-configuration
           --function-name your-lambda-function-name
           --vpc-config SubnetIds="subnet-ab12cd34","subnet-12345678",SecurityGroupIds="id-0abcd1234abcd5678"