:wave: Hi everyone! I'm new to sst. I having a pro...
# general
t
👋 Hi everyone! I'm new to sst. I having a problem about connecting to database located on a vpc from my lambda. It seems currently sst does not support vpc configuration for lambda functions, right?
t
There's actually nothing special with SST and vpcs
If this is for
sst start
your code is executing locally so it will need a path to any databases behind a VPC so you'll need a VPN
We strongly recommend VPC-less architectures though as they cause problems in a few places
If you are using a VPC in production you can specify that the lambda uses a vpc
t
If you are using a VPC in production you can specify that the lambda uses a vpc
@thdxr you mean i have to configure manually?
t
not manually, you can define in sst when creating the function
Copy code
new sst.Function(props.stack, "fn", {
  vpc: ec2.Vpc.fromLookup(this, "VPC", {
      vpcId: "vpc-xxxxxxxxxx",
    })
})
t
Can i pass that to the
defaultFunctionProps
?
t
yes you can 😄
t
i dont see any section on the docs said about that
ec2
-> ecClient from aws-sdk?
oh, found it on ts definition. Thanks