Hi, I want to handle outbound traffic from my Lamb...
# help
t
Hi, I want to handle outbound traffic from my Lambda functions with some static IP. The solution I would like to use is a dedicated VPC with private subnet and NAT Gateway coupled with Elastic IP. From the AWS Console, I can easily create Lambda functions and assign them to the VPC and subnet (which I created earlier). I achieve the same using
API
and
Function
constructs. The use case: 1. Create VPC with all subnet configuration once. 2. Deploy all SST stacks (created per PR) to the same VPC, Lambdas should be deployed to the specific subnets.
f
Hey @Tomasz Michalak, yeah I have the same setup for static IP.
I wasn’t able to catch ur question? Were you not able to set this up in SST?
t
I missed this settings, there is no issue:
Copy code
const vpc = ec2.Vpc.fromLookup(this, 'preferences-vpc', { vpcId: 'xxx' });
    const myFunction = new sst.Function(this, "myFunction", {
      handler: 'src/lambda.handler',
      vpc: vpc
    });
    const api = new sst.Api(this, "Api", {
      routes: {
        "GET /": myFunction,
      },
    });
f
Ah yup!