interface VpcConfigProperty
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Lambda.CfnFunction.VpcConfigProperty |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#CfnFunction_VpcConfigProperty |
![]() | software.amazon.awscdk.services.lambda.CfnFunction.VpcConfigProperty |
![]() | aws_cdk.aws_lambda.CfnFunction.VpcConfigProperty |
![]() | aws-cdk-lib » aws_lambda » CfnFunction » VpcConfigProperty |
The VPC security groups and subnets that are attached to a Lambda function.
When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of security group and subnet in the function's VPC configuration. The function can only access resources and the internet through that VPC. For more information, see VPC Settings .
When you delete a function, AWS CloudFormation monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is defined in the same stack, the network interfaces need to be deleted by Lambda before AWS CloudFormation can delete the VPC's resources.
To monitor network interfaces, AWS CloudFormation needs the
ec2:DescribeNetworkInterfaces
permission. It obtains this from the user or role that modifies the stack. If you don't provide this permission, AWS CloudFormation does not wait for network interfaces to be deleted.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const vpcConfigProperty: lambda.CfnFunction.VpcConfigProperty = {
ipv6AllowedForDualStack: false,
securityGroupIds: ['securityGroupIds'],
subnetIds: ['subnetIds'],
};
Properties
Name | Type | Description |
---|---|---|
ipv6 | boolean | IResolvable | Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets. |
security | string[] | A list of VPC security group IDs. |
subnet | string[] | A list of VPC subnet IDs. |
ipv6AllowedForDualStack?
Type:
boolean |
IResolvable
(optional)
Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.
securityGroupIds?
Type:
string[]
(optional)
A list of VPC security group IDs.
subnetIds?
Type:
string[]
(optional)
A list of VPC subnet IDs.