I have some experience with the Serverless framework but am new to Serverless Components and am having a little trouble trying to figure out the syntax to deploy lambda functions in AWS VPCs.
With Serverless I’ve followed this guide https://www.serverless.com/framework/docs/providers/aws/guide/functions/ to successfully deploy apps inside my vpc
per function
# serverless.yml
service: service-name
provider: aws
functions:
hello:
handler: handler.hello
vpc:
securityGroupIds:
- securityGroupId1
- securityGroupId2
subnetIds:
- subnetId1
- subnetId2
or globally
# serverless.yml
service: service-name
provider:
name: aws
vpc:
securityGroupIds:
- securityGroupId1
- securityGroupId2
subnetIds:
- subnetId1
- subnetId2
functions:
hello: # this function will overwrite the service level vpc config above
handler: handler.hello
vpc:
securityGroupIds:
- securityGroupId1
- securityGroupId2
subnetIds:
- subnetId1
- subnetId2
users: # this function will inherit the service level vpc config above
handler: handler.users
However I don’t seem to be able to find any documentation on how to launch a lambda function inside an AWS VPC with Serverless Components when editing apps/site/resources.js in an analogous way to the Serverless framework such as
component: "@webiny/serverless-function",
inputs: {
src: "./src",
vpc: {
subnetIds: [subnetId1, subnetId2],
securityGroupIds: [securityGroupId1, securityGroupId2]
}
}
In the Chinese language readme file https://github.com/serverless/components/blob/master/README.cn.md there is a mention of vpcName, and a couple of open issues on github mention vpc support, however with testing different key:value pairs I don’t seem to be able to deploy the lambda into a VPC without manually updating the vpc settings of the lambda in the AWS console.
Any help/pointers to something that I’ve missed would be appreciated.