Security11 min read

SOC2 Compliance: Setting Up VPCs with OpenTofu

Declarative infrastructure-as-code configuration for strict audit parameters.

Published by DevOps TeamJuly 29, 2026

SOC2 audit requirements demand logical data boundaries, explicit network firewalls, and immutable admin audit trails. Building these architectures manually invites configuration drift and security leaks. We declarative-code our VPC topology using OpenTofu template standards.

Isolated Network Schema

All application tasks execute inside isolated private subnets. Communication with external APIs must go through authenticated NAT gateways, while administrative console sessions require multi-factor client VPN connections.

[Internet Gateway]  --> [WAF Shield]  --> [Application Load Balancer]
                                                    |
                                                    +--> [Private VPC Subnet]

OpenTofu Declarative Module Example

resource "tofu_vpc" "production_mesh" {
  cidr_block           = "10.0.0.0/16"
  enable_dns_hostnames = true

  tags = {
    Compliance = "SOC2-TypeII"
    Security   = "Strict-Isolation"
  }
}