AWS Lambda HIPAA Compliance Guide: Requirements, Architecture, and Best Practices

Product Pricing
Ready to get started? Book a demo with our team
Talk to an expert

AWS Lambda HIPAA Compliance Guide: Requirements, Architecture, and Best Practices

Kevin Henry

HIPAA

April 03, 2026

9 minutes read
Share this article
AWS Lambda HIPAA Compliance Guide: Requirements, Architecture, and Best Practices

This guide shows you how to design, deploy, and operate AWS Lambda workloads that handle Protected Health Information (PHI) in a HIPAA-aligned way. You will learn service eligibility, encryption requirements, event handling patterns, audit trails, the Shared Responsibility Model, and concrete controls to meet technical safeguards while maintaining serverless agility.

AWS Lambda HIPAA Eligibility

AWS Lambda is a HIPAA-eligible service when your organization has an executed AWS Business Associate Addendum (BAA) and you configure the environment appropriately. Eligibility means AWS permits you to process, store, and transmit PHI using Lambda under the BAA; compliance remains your responsibility through correct architecture, configuration, and operations.

What eligibility means in practice

  • Execute the AWS Business Associate Addendum for your account(s) before handling any PHI.
  • Use only HIPAA-eligible AWS services for any component that touches PHI (e.g., Lambda, API Gateway, S3, DynamoDB, SQS, SNS, EventBridge, KMS, Secrets Manager, CloudTrail, CloudWatch).
  • Constrain data residency to approved Regions and accounts; segregate dev/test from prod with AWS Organizations and separate KMS keys.
  • Apply least-privilege IAM; scope Lambda execution roles to the minimum actions and resources.

Reference architecture at a glance

  • Ingress: Amazon API Gateway (HTTPS with SSL/TLS Encryption) or private ALB → Lambda in private subnets.
  • Data services: Amazon S3 (SSE-KMS), DynamoDB (encryption at rest), Aurora/RDS (encryption at rest), or EFS (encrypted and mounted over TLS).
  • Asynchronous processing: SQS/SNS/EventBridge with KMS encryption and dead-letter queues.
  • Security and keys: AWS Key Management Service (customer-managed keys), Secrets Manager for credentials, VPC endpoints to keep traffic private.
  • Observability: CloudWatch Logs/Metrics, CloudTrail (including data events), and Security Hub for findings aggregation.

Encryption Requirements for PHI

HIPAA’s Security Rule treats encryption as an addressable safeguard; under the BAA and modern risk standards, you should enforce encryption in transit and at rest for all PHI. Apply consistent key management and restrict where PHI can appear.

In transit (network) requirements

  • Terminate and originate only over TLS 1.2+; prefer TLS 1.3 where supported. Enforce HTTPS on API Gateway, ALB, and AppSync.
  • Use VPC, private subnets, and VPC endpoints (PrivateLink) so Lambda-to-service calls remain on the AWS network.
  • Do not place PHI in URLs, headers, or resource names; send it in encrypted request bodies.

At rest requirements

  • Default to AWS Key Management Service with customer-managed keys (CMKs) for services that store PHI (S3, DynamoDB, SQS, SNS, EventBridge, RDS, EFS, backups, and logs).
  • Separate keys by environment and data sensitivity; enable rotation and tightly scoped key policies and grants.
  • Use encryption context to bind operations to specific applications, tenants, or datasets.

Secrets and key material

  • Keep credentials, connection strings, and tokens in AWS Secrets Manager or Parameter Store (SecureString). Never hardcode secrets or PHI in Lambda environment variables.
  • Grant Lambda decryption rights only to the keys and secrets it truly needs.

Data at Rest Encryption Techniques

Object and file storage

  • Amazon S3: Use SSE-KMS with bucket policies that require kms:EncryptionContext and x-amz-server-side-encryption headers. Block public access, enable bucket versioning, and consider S3 Object Lock for immutable audit evidence.
  • Amazon EFS: Enable encryption at rest and enforce TLS for mounts. Useful when Lambda needs POSIX semantics; avoid placing raw PHI on ephemeral /tmp unless you additionally encrypt data before writing and purge it promptly.

Databases and streams

  • DynamoDB: Encryption at rest is standard; prefer a CMK you control. Consider client-side field encryption for highly sensitive attributes.
  • Aurora/RDS: Enable storage and snapshot encryption with CMKs; require TLS for client connections.
  • Kinesis, SQS, SNS, EventBridge: Turn on KMS encryption for streams, queues, topics, and event buses; enforce via resource policies.

Lambda-specific considerations

  • Environment variables are encrypted at rest; still avoid storing PHI there. Use Secrets Manager for rotation and retrieval during invocation.
  • If you must cache PHI temporarily, encrypt it with a data key from KMS before writing to /tmp and delete it at the end of the invocation.

Key management hygiene

  • Define key ownership, rotation cadence, and grant workflows. Monitor KMS via CloudTrail and CloudWatch metrics.
  • Use separate CMKs for logging, application data, and backups to minimize blast radius.

Event Data Handling Best Practices

Minimize, segment, and validate

  • Minimize PHI in event payloads; pass stable IDs or tokens instead of raw PHI when possible.
  • Segregate topics/queues/buses so PHI-carrying events are isolated and have stricter policies.
  • Validate and sanitize inputs at the edge; reject unexpected fields and redact sensitive values before processing.

Secure event pipelines

  • Require KMS encryption on SQS/SNS/EventBridge and resource policies that allow only intended producers/consumers.
  • Use dead-letter queues with encryption and alarms for replay and forensic analysis.
  • Keep PHI out of log statements, metrics dimensions, tracing annotations, and object keys.

Network and runtime hardening

  • Run Lambda in a VPC with only required egress. Prefer VPC endpoints for S3, KMS, Secrets Manager, and DynamoDB.
  • Pin dependency versions, scan for vulnerabilities, and minimize the deployment package. Use runtime sandbox policies and short timeouts to reduce exposure.

Audit Logging and Monitoring

Comprehensive audit trails are essential technical safeguards and a core HIPAA expectation. Capture who did what, when, where, and to which data—then alert on anomalies and preserve evidence.

Ready to simplify HIPAA compliance?

Join thousands of organizations that trust Accountable to manage their compliance needs.

What to log

  • CloudTrail: Management events and data events (S3 object-level, Lambda InvokeFunction, DynamoDB operations) across all accounts and Regions.
  • CloudWatch Logs: Structured, PHI-free application logs from Lambda; use log retention policies and subscription filters to centralize.
  • VPC Flow Logs, ALB/API Gateway access logs, and KMS audit logs for encryption operations.

How to monitor

  • CloudWatch Metrics and alarms for errors, throttles, DLQ depth, and latency; set SLO-based thresholds.
  • Security Hub and GuardDuty for continuous findings; EventBridge routes high-severity events to on-call.
  • Optionally add AWS Config conformance packs to track drift against required controls.

Evidence and retention

  • Store logs in S3 with SSE-KMS, access policies, and versioning. Consider Object Lock (compliance mode) for immutability.
  • Document alert runbooks and incident timelines; retain audit data per your record-keeping policy.

Shared Responsibility Model Overview

Under AWS’s Shared Responsibility Model, AWS secures the cloud and you secure what you build in the cloud. For HIPAA, the BAA clarifies this split but does not shift your obligation to implement proper controls.

  • AWS responsibilities: Physical facilities, hardware, networking, and the managed service control plane.
  • Your responsibilities: Data classification, access management, network configuration, encryption choices, monitoring, incident response, and validation of compliance.
  • Practical takeaway: Assume ownership for all identity, data lifecycle, key management, and logging decisions that affect PHI.

Compliance Controls Implementation

Step-by-step implementation plan

  1. Governance and BAA
    • Execute the AWS Business Associate Addendum for all accounts handling PHI.
    • Define data residency, retention, and breach notification requirements.
  2. Account and environment architecture
    • Use multi-account segmentation (prod vs. non-prod) with AWS Organizations and service control policies.
    • Centralize logging and KMS administration in a security account; restrict cross-account grants.
  3. Identity and access management
    • Enforce least privilege with IAM roles for Lambda; deny wildcard actions and resources.
    • Require MFA for administrators; use permission boundaries and session tags for context-aware access.
  4. Encryption and keys
    • Adopt customer-managed CMKs; separate keys for data, logs, and backups. Enable rotation and detailed key policies.
    • Use encryption context to bind operations to application or tenant attributes.
  5. Network and endpoint security
    • Place Lambdas in private subnets; route to AWS services via VPC endpoints. Block public S3 access.
    • Terminate external traffic with SSL/TLS Encryption and approved ciphers; enforce HTTPS-only.
  6. Data lifecycle and minimization
    • Keep PHI out of URLs, logs, and environment variables. Tokenize or pseudonymize where feasible.
    • Automate retention, deletion, and backup encryption; verify restores as part of DR testing.
  7. Application security
    • Validate inputs at the edge; sanitize and redact before logging. Use idempotency keys and DLQs.
    • Continuously scan dependencies; sign and verify artifacts in CI/CD.
  8. Monitoring, audit trails, and alerts
    • Enable CloudTrail org trails with data events; set CloudWatch alarms on anomalous API usage and KMS activity.
    • Aggregate findings in Security Hub; route critical alerts via EventBridge to incident responders.
  9. Validation and evidence
    • Map controls to HIPAA technical safeguards; capture screenshots, policies, and automated reports as evidence.
    • Run periodic security assessments and tabletop exercises; remediate promptly.

Conclusion

HIPAA-ready Lambda workloads hinge on disciplined key management with AWS Key Management Service, end-to-end SSL/TLS Encryption, strict event hygiene, and verifiable audit trails—implemented within the guardrails of the Shared Responsibility Model. By following the controls above, you can meet technical safeguards while preserving the speed and scalability of serverless.

FAQs.

What steps are required to make AWS Lambda HIPAA compliant?

Execute the AWS Business Associate Addendum, restrict PHI to HIPAA-eligible services, enforce encryption in transit and at rest with customer-managed KMS keys, segment networks with VPC endpoints, implement least-privilege IAM for Lambda roles, keep PHI out of logs and environment variables, enable comprehensive CloudTrail and CloudWatch monitoring, and document policies, procedures, and evidence to support HIPAA technical safeguards.

How does AWS Lambda handle encryption for PHI?

Lambda integrates with AWS Key Management Service so you can encrypt data at rest in dependent services (S3, DynamoDB, SQS, SNS, EventBridge, RDS, EFS) and decrypt secrets at invocation time. For data in transit, you terminate and initiate only over TLS 1.2+ using API Gateway or ALB and keep service-to-service traffic private with VPC endpoints. Avoid storing PHI in environment variables; retrieve encrypted secrets instead.

What is the role of audit logging in HIPAA compliance for Lambda?

Audit logging provides the verifiable record of access and change that HIPAA expects. You capture CloudTrail management and data events, structured CloudWatch logs free of PHI, and supporting network and KMS logs. Together, these audit trails enable detection, investigation, and evidence for assessments, backed by retention, immutability, and alerting.

How does the shared responsibility model affect HIPAA compliance?

AWS secures the underlying cloud infrastructure, but you are responsible for configuring and operating your Lambda workloads to protect PHI. That includes identity, encryption choices, network design, logging, monitoring, incident response, and demonstrating that your technical safeguards meet HIPAA requirements within the terms of the BAA.

Share this article

Ready to simplify HIPAA compliance?

Join thousands of organizations that trust Accountable to manage their compliance needs.

Related Articles