I tried all solutions exposed here and in other topics but I still fail configuring a lambda to connect to an existing VPC: the lambda is always in “NO VPC”. I use sls 1.26.0. This is my serverless.yml file (I replace sensitive data by xxx):
service: myservice
provider:
name: aws
stage: ${opt:stage, 'dev'}
region: eu-west-1
environment:
STAGE: ${self:provider.stage}
package:
artifact: dist.zip
functions:
metrics-to-splunk:
handler: LogForwardingToSplunk.handler
timeout: 300
memorySize: 1024
runtime: nodejs6.10
vpc:
securityGroupsIds:
- sg-xxxxx
subnetIds:
- subnet-xxxx
- subnet-xxxx
environment:
SPLUNK_HEC_URL: https://xxxxx
SPLUNK_HEC_TOKEN: xxxxx
Could someone show me a working full example? Or point me to what I did wrong?