I am trying to deploy a Lambda into a non-default VPC. The steps I took are,
serverless create --template aws-nodejs --path hello-world-sv
I then edited the serverless.yaml file and added,
vpc: securityGroupIds: - sg-98f38XXX subnetdIds: - subnet-978ffXXX - subnet-5e59fXXX
But however my lambda is not deployed in a VPC. Here is the full serverless config (removed comments),
service: hello-world-sv provider: name: aws runtime: nodejs8.10 vpc: securityGroupIds: - sg-98f38XXX subnetdIds: - subnet-978ffXXX - subnet-5e59fXXX stage: dev region: us-east-1 functions: hello: handler: handler.hello
(only change from actual was I masked a few of the subnet/security group values with XXX) Yes those subnets and security group exist in the VPC I want the lambda in. I can successfully add the VPC configuration via the console w/ the exact same ids I use in the serverless.yaml file, I see no reference to VPC in the resulting cloudformation template. I should note that when I add the vpc section to the serverless.yaml file the IAM Role is updated/created with the managed policy of ‘AWSLambdaVPCAccessExecutionRole’ added so at least that is working correctly.
Any help would be much appreciated.
running command with a profile that has Administrator access to AWS env.