Serverless with HIPAA and VPC

I’m planning to do a HIPAA compliant web-app and curious if I would need a VPC for my lambda function, especially where I’m using managed services (which has been my approach for previous web-apps not requiring compliance). I’m planning to use architecture I’m used to and mentioned in this article:

  • CloudFront+S3
  • Cognito for auth
  • API Gateway authorized with Cognito
  • Lambda to handle API requests (context encryption will happen here for sensitive fields)
  • DynamoDB
  • KMS to encrypt the table, CloudTrail logs, and anything stored in parameter store for environment variables the lambda

I am also leaving out a lot of the standard encryption/HIPAA details (specifics on logging, encryption at rest/in-transit, using TLS, etc).

I understand that only Lambda would be placed within the VPC with endpoints to the DynamoDB table. Is it still best to have the VPC or defensible to not use it here?


Related discussions:

What are the right/core skills required to ramp up fast to AWS design, architecture and deployment?
Advice on Infrastructure as Code
Amazon CloudFront now in Montreal and Toronto
Help with ELB health check
Why will launching EMR into one of my client's vpc just not work?
What is the use of Elastic IPs, if I can use Elastic Load Balancing or an Auto Scaling Group instead?
What is the Correct Tool for Adding Cognito Authentication to a Single Page App
Running aws-cli Commands Inside An AWS Lambda Function
Lambda node create text file in S3 from string value?
Lightsail Object Storage CORS Policy
Best practices on deploying to AWS in an autoscaled group?
Trying to decide whether we should bake or bootstrap
AWS Free Usage Tier Now Includes Amazon CloudFront
Building an HVM AMI from scratch
VPN and VPCs
How do you recruit AWS-savvy workers?
AWS Lambda - The Complete Guide. Now available on Udemy and 25 free places for members of this subreddit (see comments for details).
Multiple CloudFront origins spread across two sites
Need to hire a dev familiar with AWS to setup an API + Database
WSJ: Rackspace Teams Up With Amazon
If CloudFront can do dynamic content, then what would the difference be from using an EC2 instance with beanstalk?
T2.nano's - Where are they?
Routing help with S3 / Cloudfront and EC2
S3 file watcher lambda?
Google has quietly launched its answer to AWS Lambda (x-post /r/CloudComputing)
No ETA on CloudFront HTTP/2 support
AWS Lambda & British Summer Time
Launch instances on EC2-Classic
Any good walkthroughs for building secure infrastructure?
Joining Auto-Scaled Windows AMIs to domain
AWS Lambda python to RDS Postgresql
API Gateway: Possible to have a single Get method return a single item or a list of items?
What tools do you use to build Lambda deployment packages?
What's your Vulnerability and Patch Management process like?
Is it possible to copy an encrypted RDS snapshot to a different region using Lambda?
Map/"translation" tool for Cisco ACI Tenants, EPGs, contracts and service graphs to AWS VPCs, SGs, etc?
AWS VPC Core Concepts in an Analogy and Guide
VPN over ENI, asymmetrical routing kicking my butt
Run Headless Chrome On AWS Lambda
Step Function for building AMIs
View Local Files with Lambda
AWS account still not active
AWS Lambda: How to exit cleanly (context/callback) from an anonymous function in node.js?
AWS Greengrass (Run AWS Lambda Functions on Connected Devices)
I can't connect to my RDS, tried almost everything
Creating an AMI using Labda
ELI5, difference between a PV and HVM AMI.
Lambda and compiled libraries (python)
How long will I wait for Lambda@Edge preview access?
Learning AWS with Free Tier
How many successive Lambda invocations will use a warmed-up container?
AWS: serverless testimonials; warnings; hints
VPC Dropping isakmp packets?
Identifying instances based on AWS log stream
How to Automate AMI Backups and Cleanups, using AWS Lambda (Serverless), with EC2 Tags
Unreasonable Amount of Failed 0/2 Status Checks EC2?
Need some help re-architecting
Can an AMI trial license be abused by regularly regenerating a new instance
Going serverless, but how to setup a workflow and development environment?
AWS Direct Connect and S3 - Private Virtual Interface
I published some of my notes on AWS Lambda, short and sweet, hope they’re useful
Is there IDE support for lambda-based applications?
AWS Lambda Cheatsheet
Does a Cognito JWT update if attributes are changed?
Where to put a Python Library for access in Lambda?
reInvent session bookings
Confused about Cognito User Pools, Cognito Identity, API Gateway
CloudFront to serve 2 different apps (static content)
Hosting 2 react apps on the same Cloudfront distribution
AWS PrivateLink Update – VPC Endpoints for Your Own Applications
A crash course on Serverless with Node.js
Decreased performance on spot instances compared to on-demand
Would You Build a Whole Web App on Lambda?
S3 Static Website + Cloudfront question
VPC peer can't ping / telnet to servers on the other side.
Region must be actively set from code running in EC2?
Script advice for starting a service
What was your first Lambda Command?
Lambda -> RDS and connection pooling issues?
What business problem does serverless computing solve?
AWS Serverless Application Repository Now Available
DHCP Options (VPC) question
A Beginners Guide On How To Create A Serverless RESTful API With NodeJS And AWS
Lambda lock-in - worst thing ever or overblown hype train? Need a devs perspective
AWS lambda - API gateway : Malformed Lambda proxy
Spacy on AWS Lambda
AWS Lambda Adds Amazon Simple Queue Service to Supported Event Sources
AWS Lambda - Python 3.6, pyodbc, and SQL Server driver - ODBC driver
AWS Support Ratings
I had a chat with /u/jeffbarr: “The Wizard of AWS.”
Can the same lambda be called multiple times to run in parallel?
Amazon SQS as a Lambda event source = all the fun!
Route 53 NXDOMAIN Issue
aws-serverless-express cold starts are slow
Tools to monitor customer usage for SaaS built on AWS?
Using ACM with Cloudfront on EC2 works for root URL but other pages get 502
Best way to protect API Gateway with Cognito
Suggestions for a Website Builder with integration for AWS Cognito
Cognito. How are people backing up and replicating user pools
How to copy an EC2 instance to a new region?
Show Reddit: Code assistance in any IDE when working with boto3
anyone using lambda with snowflake? basic connection error
Cognito alternative or a solution?
Palo Alto static route tunnel to vpc
Anyone know why I'm getting this with cloudfront signed cookie? The cloudfront url definitely finds the 3 cookies that are set, but it says MissingKey still. Any ideas?
Best way to manage Heroku Postgres credential rotation in AWS Lambda?
Shutdown instances by combination of VPC, subnet and instance type
into container registries and security? come help us build ECR!
Dedicated Lambda for database operations?
Take the AWC CSA Associate exam, and then take the Professional one a few months later, or go for gold?
Using aws-sdk inside lambda?
How can I use AWS Lambda to trigger data changes?
Is there a Lambda layer directory you can browse
Windows: How to connect instance to instance, by instance name?
S3 not working after accidentally changing back google NS
When uploading a file to S3, how can a lambda function deny a PutObject operation if the object key already exists in the bucket?
Code to find the "gaps" in subnet allocation in a VPC?
VPC Architecture for a startup
Relative single threaded performance of t3.nano with and without CPU Credits
Using lambda functions asynchronously
Deploy a single page app on AWS (S3, CloudFront, ACM & Route53) in one command
Lightweight Serverless API Using AWS Lambda and ALB
Official video tour of AWS Outpost rack, including server and network hardware
EC2 Instance Identification [AWS Newbie]
Using Amazon Cognito for multiple services on the same website. We want them to be logged in to every service when they log in. Should each service have it's own client or should it all be the same client?
Does using the AWS Linux 2 AMI for an autoscaling launch configuration go against best practice?
Filtering VPC outbound traffic based on target domain names.
[HELP/ADVICE] Best ways/examples of testing lambda functions
API Gateway and Cognito Authorizer (HTML/CSS/JAVASCRIPT)
Why I pick Heroku over AWS Lambda for my SaaS. But not always.
AWS CDK for Python example project: Inspector
Whats with the AWS service naming scheme
Need help in hosting project in AWS.
Best Practice for Hosting a Client's Site?
AWS Lambda now supports Node.js 12
Accidentally pre-announced: Provisioned Concurrency for Lambda Functions
RDS Proxy for Lambda!
Multiple domain SSL for static web hosting with S3 + Cloudfront
Testing AWS Lambda functions locally on AWS Workspace
Python 2.7 EOL. Runtime Support Policy
Cognito for SPA and API Authentication for OAuth2 Design and Recommendations
λ 🖼️ Chromda is an AWS Lambda function for capturing screenshots of websites.
Serverless Web Scraping with AWS Lambda
ReactJS + Amazon Cognito + Amazon Amplify Framework starter project
Looking to run my Python code on AWS without maintaining a server (not Lambda?)
How are you guys performing cost optimisation?
Multi-tenant app using AWS Amplify
Best practice for API and Lambda
AWS MSK serverless
Should I always verify JSON Web Tokens that get returned from Cognito?
Evaluating Basic Domain/Hosting/SSL options on AWS
pg_dump to S3
How to Provide Static IPs to AWS Lambdas in a Fault-Tolerant Way
Can multiple public URLbe part of one AWS CloudFront & WAF service?
Where are AWS Published Lambda Layers, I am looking for Numpy, Scipy and Pandas Lambda Layer published by AWS? Are there one?
Any reason *not* to deploy an S3 gateway in a VPC?
10 Recommendations for writing pragmatic AWS Lambdas in Python
AWS newbie -- setting up periodic data collection with lambda functions
Cognito Auth token, getting the username from the lambda function
Connecting to a third party websocket - Lambda, EC2 or something else?
AWS Lambda or AWS Batch
Change AWS instance type from c5.large to t3.large
Adding simple-salesforce Library to AWS layer for Lambda
Can I run amazon-ssm-agent on Flatcar Container Linux?
Lambda function check health application
Is there ANY real reason one would not want to lower the TTL for caching with CloudFront? Noticed I have to wait 24 hours for changes to fully update on Cloudfront from S3 bucket...but don't see why I wouldn't want to set it to 1 hour instead. Help?
Serverless Swagger UI for API Gateway
CDK Native Applications - Are there any established patterns for highly integrated apps?
Web hook strategies
Transition from VPS and cost comparison
JavaScript + Cognito without the Frameworks?
Demystifying AWS VPC
Outage aftermath: How to avoid Cloudwatch event cron triggers from queuing up?
Lambda just got per-ms billing
Is serverless taking over?
Serverless UI - What's the best approach?
Whats a good DynamoDB response time?
PSA: New public VPC showed up in ap-northeast-3
Resources to automate lambda performance testing ?
using base64 encoded emailId in the REST URI in API gatewa
Getting Started in AWS
AWS Cognito with Heroku
Serverless Framework vs SAM vs AWS CDK
MongoDB Backups to S3
Amazon Linux AMI - How to upgrade PHP 7.2 to PHP 7.4
AMI deletion protection or restoring a deregistered AMI
How to implement Cognito with/without Amplify on pure HTML & JS?
r5.2xlarge equivalent with half the vCPU?
Monolith app to lambdas: how to do auth?
Abusing AWS Lambda to make an Aussie Search Engine
Managing a project with SAM and Amplify [beginner question]
Nat for server that moves AZ's due to spot instance
Any experience with serverless Apollo on Lambda?
How to automatically update my Lambda functions everytime a new version of docker image has been pushed to ECR?
CDK: Encrypt Lambda environment variables?
Help with LambdaA invoking LambdaB async without awaiting response
AWS Free Tier Data Transfer Expansion – 100 GB From Regions and 1 TB From Amazon CloudFront Per Month
Is it possible to add a behavior to a CloudFront distribution that routes a path to API Gateway?
Cors Issue when connecting React Application to AWS Lambda using API Gateway HTTP API
AWS Lambda: How to revert back to in-line code editing after uploading a .Zip?
I'm an AWS Serverless convert now. (CloudFront -> S3 -> API Gateway -> Lambda -> DynamoDB)
Step function vs Lambda function
Deactivated SFTP servers from AWS transfer family but still getting charged - can you delete a server but still save all configurations/settings somewhere to spin it up easily later?
How We Sped Up Our TypeScript Serverless Builds Ten Times (70 Lambdas Under 1 Minute)
What Exactly are VPC Endpoints and Why They Need Real Inter-Region Support (2022-03-01)
Where did Lambda Function URLs go?
Building serverless multi-Region WebSocket APIs
API Gateway to expose subset of external API?
Can we use lambda layers across multiple aws account
Introducing Stacktape - Full power of AWS with Heroku-like experience
Lambda consuming from SQS is not scaling as expected, what could be happening and what options do I have instead?
How to test app with DocumentDB and Express from local machine if can't connect to DocDB outside the VPC.
Using Kotlin in a Serverless Architecture with AWS Lambda
AWS Lambda adds support for Node.js 16
I need Lambda #1 to call Lambda #2. Is it better to call directly using the SDK, or should Lambda #2 be behind an API that Lambda #1 hits?
Multiple (basic) questions regarding aws networking
How to Fail at Serverless
API Gateway: Rest API vs. HTTP API
New – HTTP/3 Support for Amazon CloudFront | Amazon Web Services
Auto scaling group is unable to launch an instance
How to run a lambda n seconds after a different lambda finished running?
AWS issues in US-West-2 region - Lambda, API gateway, Connect
What's my best option for storing data through a Lambda function that can be retrieved in the next execution?
API Gateway HTTP to HTTPS redirection
Cognito users: switch this on
Lambda with API gateway not getting payload of body
I cannot seem to do a basic fetch on Lambda
No Cognito announcements from re:Invent?
Can you re-use the same code you made for lambda in an EC2 to do the same thing?
Add HTTP streaming to your Lambda with practically 0ms added latency
How do I access private api(apigateway triggering lambda inside a vpc) from the internet.
AWS Lambda, a good host for a rest API?
I spotted the cable on the map, and it is operational, then how could I use it?
Using AWS Cognito & Amplify To Handle All The Login, Register, Email Verification Etc. For You - JS Example (No React, Vue, Angular Etc)
Using golang in AWS
Advice on a simple database architecture
Why does Cognito get a bad wrap?
Need help with dns to api gateway.
At a loss with this lambda to invalidate my cloudfront distribution. It works through the console, and with the cli, but not with my lambda and the logs show no errors. The IAM role for the lambda has the proper permissions. I'm really at a loss, ple
AWS VPC Endpoints pricing
Can I use the same internet gateway for multiple VPCs?
Amazon Prime: "Microservices to Monolith"
AWS Lambda SSE Implementation: Subsequent Calls Result in Internal Server Error without Error Logs
How do I grant ecr:DescribeRepositories permissions to an external AWS account
VMware/ESXi/vSphere on an AWS Snowball?
AWS Garbage Service Reply Times Lately? We Spend 15k/Month
AWS Resources for noob
In-memory caching in Lambda based application.
Working implementation of AWS EKS + Cilium vxlan (no more pod limits, no more stuck pods/IP issues)
What AWS service do you find most frustrating?
AWS Public IPv4 Address Charge + Public IP Insights
Ask advise: How to Design an architucture to efficently store and use the data?
Amplify Hosting vs CloudFront+S3
I get the impression that Serverless Framework is dying --- thoughts?
How to Build a Serverless Image Generator API (open-source code included)
How to route specific users to a canary version in blue green deployments
What's your experience with getting service quota increases?
Debugging AWS Lambda Functions with a Reverse Shell
Is it possible to prevent a Lambda trigger from deleting SQS messages?
SNS to Lambda vs Invoke Lambda Directly
Concurrent Lambda Logging (Python)
In Lambda, what's the best way to download large files from an external source and then uploading it to s3, without loading the whole file in memory?
Testing Lambdas Locally - Need Guidance
S3 static website still accessible outside of AWS Cognito. Where am I going wrong here?
How do I document code for an HTTP API Gateway?
Watch AWS Lambda scale
Using multiple lambda functions to get around the size cap for layers.
How can I tell what is using a VPC?
Securing AWS Cognito Signup Route
Lambda is the most expensive part of a project, is this normal? When to choose lambda / Ec2.
AWS API Gateway Workflow?
Generic Failure Launching EC2 instance in Denver AWS Local Zone
How to pass a 25 MB JSON file to Lambda Function using API Gateway
How do you do observability right when running an AWS Lambda backed API?
Unzip 2 gigabytes files on S3 Upload with AWS Lambda
Running 4000 jobs with lambda
I am prototyping the architecture for a group of microservices using API Gateway / ECS Fargate / RDS, any feedback on this overall layout?
Spliting used subnet in AWS
Cloud Support Engineer Technical Interview Tips?
Overwhelmed by CDK? Here's a Simple Guide for Deploying TypeScript Lambdas
One account to rule them all
Creating Cognito User Pool: benefits/risks of social sign in?
Best Workaround for Multi-Region Cognito Setup?
AWS Cognito Down In Us-East?
Handling multi-tenancy in pooled DynamoDB table
Is there a limit on the total number of Lambda functions?
Aviatrix instead of NAT Gateways
Inherited AWS infrastructure - Routing issue
Cognito Managed Login
From Lovable.dev to stable AWS Infrastructure
AWS ALB + CloudFront
💡 “I never said serverless was easier. I said it was better.” – Gillian McCann
Is Cloudfront (or other CDNs) still necessary if the customers are only one region?
Deploying a Websocket on AWS
Hosting SPA on S3 + CloudFront – Is traffic from S3 (HTTP) to CloudFront secure? Concerned about JWTs
How to connect securely across vpc with overlapping ip addresses?
PyAudio on Lambda
Learn Serverless on AWS: Live Demo & Walkthrough – Wednesday, Aug 27
How can I recursively invoke a Lambda to scrape an API that has a rate limit?
SQS + Lambda - alert on batchItemFailures count?
The architecture behind my sub-500ms Llama 3.2 on Lambda benchmark (it's mostly about vCPUs)
Does Amplify cost 0$ for small app?
Recent AWS CLI s3/streaming change
Is Amazon Cognito a good choice long term? Alternatives?
I built an AWS Console-style dashboard for Floci, the open-source local AWS emulator
Probably can't do this, asking anyway
Lambda Gets 90 Minute Timeout
AWS Lambda execution suspended 8 days after notifying AWS of a potential compromise on the root account. No response from support.
Amazon API Gateway
AWS Outposts
Passed CSAA today!
AWS Tutorial - Scenario 2 VPC with Public & Private Subnets and NAT Gateway
How important are the white papers and faq's for the SAA?
Retaking my SAA 3/21...I hope
Passed CAA-02 at 3 AM
Obligatory "Passed my" Developer Cert
AWS Lambda- the future of serverless application development
AWS data analytic exams
Solutions Architect Associate any help here?
Can anyone explain the answer?
Wider Adoption of Containers Highlights Security Concerns
Can Hybrid Cloud Address Data Localization Challenges Amid COVID-19?
List of online AWS training providers
Cloud Services Projected To Grow Amid COVID, Why Do MSPs Need To Focus on Trends?
Pen and Paper allowed for Online Test
3 Upcoming AWS GameDay Events - FREE, gamified, hands-on learning
CCP or straight to SAA?
OnVue Exam - Video Streaming Issue
My Experience in Passing the AWS Certified SysOps Administrator SOA-C02 exam
Asking the SAs out there
Passed CLF-01 | CCP
Automation of AWS
SOA-C02 passed!
Passed SAA- CO2
AWS - Networking Speciality by Stephan on Udemy
i got this error msg while creating VPC. Can someone walk me through about the problem here...?
Passed my SAA yesterday.
conditional aws lex bot
I made a quiz to test your AWS WAF knowledge
Cross account redirecting; CF > CF vs CF > AGW?
Learn C of Aws(Cloudfront)
Passed AWS Certified Developer Associate with 866 marks
Cloudhub Doubt
Solution Architecture Question related - Configuring Reserved & Provisioned together
Passed DVA-02
Improving CloudFront cache-hit ratio: how does compression improve cache-hit ratio?
New Hire- Has 2 pro certs & CCNA but unable to create subnets in a /24 VPC??
Practice question: What is the most cost-effective way to host a static website on AWS?
Set of AWS Lambda questions + explanations
It seems @Cedw is winning in the SAA quiz right now! Anyone able to beat this high score?! 👀 (link: https://d3vhln997vukvf.cloudfront.net/)
Tip for staying under the 250mb Lambda limit
Question for gathering logs from multiple AWS accounts
New to aws. After reading aws docs for almost a week I still feel lost. Need help building my first aws ios app.
Maintenance of Lambda Functions?
Help with AMI root partition sizing
Dealing with AWS eventual consistency in code.
Containers & AWS

There is very little downside to putting it in a VPC. I would.

There isn’t a huge downside to Lambda in VPC IMHO. So why leave it as something for the auditor to ask about?

FWIW when I had to create a similar setup, I used cdk-nag to tell me what I missed. It allows you to mark things as ignored in code, with a reason. So when the auditor comes, it’s a simple CSV export that includes results + ignore reasons.

Wow thanks for sharing that. Really helpful for someone who is trying to navigate it all.

Layers 1, 2 and 7 of Building a HIPAA-ready generative AI architecture for healthcare on AWS are helpful.

hipaa is more about your controls and audit trail that whether every lambda sits in a vpc, but if you out it in a pvc you also take on endpoint and networking that your team has to maintatin

Doesn’t lambda have tenant isolation? Perhaps that could be used in place of isolating lambda to the VPC.

Will be ok for hipaa as long as you have all the encryption enabled like you said.

The biggest issue with lambdas is actually the customer cyber audit. If your customer is a big hospital they tend to have difficulty wrapping their head around this execution model and from experience will stall approval in a system. The biggest issues I have seen with lambdas not in vpc were not having mandatory firewall controls. For this they accept security groups in vpc even though that’s it really a “firewall”. And second issue in review is that they may ask for an endpoint detection and response software tool to be installed which really doesn’t make sense for lambda. We had so many issues with this that I converted to ECS fargate with guard duty even though technically there is more risk of the ECS task being taken over. But it as getting impossible to get through customers because they have a checkbox for EDR that they needed to approve.

Lambda does offer tenant isolation and its primary use case is multi-tenant SaaS. I don’t know if the OP’s HIPAA application is multi-tenant, however. The benefit of VPC is that you can then configure PrivateLink from your application to AWS services like DynamoDB and that makes it easier to convince your auditor that you’re keeping PHI off the public internet**

** in practice even if you don’t use PrivateLink, traffic between Lambda functions (or EC2 instance etc.) and AWS service endpoints stays on the AWS private network regardless, even if they’re logically routed via NAT and IGW.

In this case, there is no intrinsic value in putting your Lambda into a VPC, indeed I would consider it security theater.

> I understand that only Lambda would be placed within the VPC

Configuring a VPC for a Lambda function doesn’t “place” the function in your VPC. Lambda functions always execute in Amazon managed accounts. What configuring a VPC for a function does is cause the creation of a Hyperplane ENI which acts as a bridge between the Amazon account and the VPC in your account. And as for the belief I’ve seen expressed in comments that using a VPC and VPC Service Endpoints keeps your AWS API traffic from going over the public internet unlike when using public endpoints, I’m pretty sure when using public endpoints while running in Amazon your AWS API traffic never leaves their network.

Very nice. Thank you.