-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-lambda: VpcConfig is not configured for Lambda Function without specifying Vpc prop #26508
Comments
Agree. |
Specifying the `securityGroups` property requires a `vpc`. This fix adds validation for the case when a `vpc` is not specified, but `securityGroups` is. It also adds validation for the case when both `securityGroups` and `allowAllOutbound` are specified (`allowAllOutbound` should be configured in the SGs). **Question for the reviewers** How should we handle the case of an empty list in `securityGroups`? (eg `securityGroups: []`) Closes #26508. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
When we are using the Security group without VPC for @aws-cdk/aws-lambda package it was working well but when we have migrate it to the aws-cdk-lib/aws-lambda package we are getting following error message, Kindly suggest the possible solution for it. |
Describe the bug
Specifying
securityGroups
without specifyingvpc
prop in Lambda Function leads toVpcConfig
not added to the generated CloudFormation Template.Expected Behavior
VpcConfig is added to Lambda Function:
Current Behavior
VpcConfig is not in Lambda Function
Reproduction Steps
The following code does not add
VpcConfig
to CloudFormation template for Lambda function:However, by adding
vpc
toprops
, nowVpcConfig
is added to the CloudFormation templatePossible Solution
securityGroup
(no s) is deprecated and CDK is not throwing error ifsecurityGroups
is specified andvpc
is not specifiedaws-cdk/packages/aws-cdk-lib/aws-lambda/lib/function.ts
Lines 1225 to 1227 in 39a1d6b
Additional Information/Context
No response
CDK CLI Version
2.87.0
Framework Version
No response
Node.js Version
18
OS
Window
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: