For the complete documentation index, see llms.txt. This page is also available as Markdown.

VPC Configuration

Overview

Frigg provides VPC networking support for your Lambda functions with two main approaches:

  1. AWS Discovery (Default): Automatically finds and uses your existing VPC infrastructure

  2. Infrastructure Creation: Creates new VPC infrastructure when explicitly requested with createNew: true

When VPC is enabled, Lambda functions gain enhanced security through network isolation. The AWS Discovery approach leverages your existing VPC setup, while infrastructure creation is available for cases where you need dedicated networking resources.

Quick Start - AWS Discovery (Default)

The default approach automatically discovers and uses your existing VPC infrastructure:

const appDefinition = {
    name: 'my-frigg-app',
    integrations: [
        // your integrations...
    ],
    vpc: {
        enable: true  // Default: Uses AWS Discovery to find existing VPC resources
    }
}

module.exports = appDefinition;

This is the recommended approach because:

  • βœ… Zero infrastructure costs - uses existing resources

  • βœ… Fast deployment - no resource creation delays

  • βœ… Integrates seamlessly with existing network setup

  • βœ… Production ready - leverages proven infrastructure

  • βœ… No CIDR conflicts - works with any existing VPC CIDR ranges

AWS Discovery Mode (Default)

When using AWS Discovery, Frigg automatically finds your existing VPC resources:

What Gets Discovered

  • Default VPC or first available VPC in your account

  • Private Subnets with proper routing for Lambda functions

  • Security Groups suitable for Lambda outbound traffic

  • Route Tables that support internet access

  • Default KMS Key for encryption operations

What Gets Created for Lambda Internet Access

Even with existing VPC, Lambda functions need guaranteed internet access for external API calls:

  • NAT Gateway with Elastic IP (~$45/month) - required for outbound HTTPS to Salesforce, HubSpot, etc.

  • Route Table with NAT Gateway routing for Lambda subnets

  • Subnet Route Associations to ensure Lambda traffic uses NAT Gateway

  • Lambda Security Group with outbound rules for:

    • HTTPS (443) - API calls

    • HTTP (80) - HTTP requests

    • DNS (53 TCP/UDP) - Domain resolution

  • VPC Endpoints (optional, cost optimization):

    • S3 Gateway Endpoint (free)

    • DynamoDB Gateway Endpoint (free)

    • KMS Interface Endpoint (~$22/month, if KMS enabled)

IAM Permissions

  • ENI Management permissions for Lambda VPC operations

Infrastructure Creation Mode

For new VPC infrastructure, add createNew: true:

Complete VPC Infrastructure Created

  • VPC with DNS resolution enabled (configurable CIDR)

  • Internet Gateway for internet connectivity

  • Public Subnet for NAT Gateway

  • 2 Private Subnets in different AZs for Lambda functions

  • NAT Gateway with Elastic IP for private subnet internet access

  • Route Tables properly configured for internet routing

  • Security Groups for Lambda and VPC endpoints

Configuration Options

Basic VPC with AWS Discovery (Default)

Explicit Resource IDs (Override Discovery)

Create New VPC Infrastructure (Explicit Opt-in)

Disable VPC Endpoints (Cost Optimization)

Environment-Specific Configuration

Generated Infrastructure

Complete CloudFormation Resources

Cost Optimization

Environment-Specific VPC

When to Use VPC

βœ… Enable VPC For:

  • Production applications requiring network isolation

  • Compliance requirements (SOC 2, HIPAA, PCI DSS)

  • Integration with existing VPC resources

  • Enhanced security posture

  • Cost optimization via VPC endpoints

Migration and Compatibility

Existing Applications

  • Zero breaking changes - add vpc: { enable: true } when ready

  • Gradual rollout - enable per environment

  • Rollback friendly - disable flag to revert

Advanced: AWS Discovery with KMS and SSM

Production Setup: Explicit Resources

Last updated

Was this helpful?